Arithmetic decoding device, arithmetic coding device, image decoding apparatus, and image coding apparatus

ABSTRACT

A coefficient presence/absence flag decoding unit ( 124 ), included in a quantized residual information decoding unit ( 111 ) which reduces a processing amount related to coding and decoding of a transform coefficient, splits a target frequency domain or a target pixel domain into sub-blocks, and derives different context indexes with respect to each transform coefficient in a pixel domain, obtained through a transform skip or a transform/quantization bypass, and each transform coefficient which is obtained for each frequency component through frequency transform.

TECHNICAL FIELD

The present invention relates to an arithmetic decoding device fordecoding coded data which is arithmetically coded, and an image decodingapparatus including the arithmetic decoding device. In addition, thepresent invention relates to an arithmetic coding device for generatingcoded data which is arithmetically coded, and an image coding apparatusincluding the arithmetic coding device.

BACKGROUND ART

In order to efficiently transmit or record moving images, a moving imagecoding apparatus (image coding apparatus) for generating coded data bycoding a moving image, and a moving image decoding apparatus (imagedecoding apparatus) for generating a decoded image by decoding the codeddata, are used.

As a specific moving image coding method, for example, there are methods(NPL 1) proposed in H. 264/MPEG-4. AVC, and High-Efficiency Video Coding(HEVC) which is a succeeding codec thereof.

In such moving image coding methods, an image (picture) forming a movingimage is managed in a layer structure which is constituted by a sliceobtained by dividing the image, a coding unit obtained by dividing theslice, and a block and a partition obtained by dividing the coding unit,and the image is commonly coded and decoded for each block.

In addition, in these coding methods, typically, a predicted image isgenerated on the basis of a local decoded image obtained by coding anddecoding an input image, and coding is performed on a transformcoefficient which is obtained by performing frequency transform such asdiscrete cosine transform (DCT) on a difference image (also referred toas a “residual image” or “prediction residual” in some cases) betweenthe predicted image and the input image for each block.

As a specific coding method of a transform coefficient, context-basedadaptive binary arithmetic coding (CABAC) is known.

In the CABAC, a binarization process is performed on various syntaxesindicating a transform coefficient, and binary data obtained through thebinarization process is arithmetically coded. Here, the various syntaxesinclude a flag indicating whether or not a transform coefficient is 0,that is, a flag significant_coeff_flag (also referred to as coefficientpresence/absence flag) indicating whether or not a non-zero coefficientis present, a flag coeff_abs_level_greater1_flag (also referred to as aGR1 flag) indicating whether or not an absolute value of a transformcoefficient exceeds 1, a flag coeff_abs_level_greater2_flag (alsoreferred to as a GR2 flag) indicating whether or not an absolute valueof a transform coefficient exceeds 2, syntaxes last_significant_coeff_xand last_significant_coeff_y indicating a position of the last non-zerocoefficient in a process order, and the like.

In addition, in the CABAC, when a single symbol (also referred to as 1bit of binary data, or a Bin) is coded, a context index is referred to,and arithmetic coding corresponding to an occurrence probabilityindicated by a probability state index included in a context variabledesignated by the context index is performed. For example, in a casewhere a target syntax of arithmetic coding is a coefficientpresence/absence flag, the context index is derived in accordance with aposition in a frequency component of a transform coefficient. Inaddition, the occurrence probability designated by the probability stateindex is updated whenever a single symbol is coded. Further, in thefollowing description, a process of deriving a context index which isreferred to when a specific Bin is coded is also referred to as acontext deriving process.

In NPL 1, as a method of coding signs indicating positive and negativetransform coefficients, sign hiding is employed. The sign hiding is amethod in which a sign of a transform coefficient is not explicitlycoded but is calculated through computation.

In addition, in NPL 1, two-layer coding is employed as a method ofcoding a non-zero coefficient. In the two-layer coding, the transformunit is split into a plurality of sub-blocks, a flag(significant_coeff_flag) indicating whether or not a transformcoefficient is non-zero is coded for each transform coefficient includedin each sub-block, and a flag (significant_coeff_group_flag) indicatingwhether or not a non-zero coefficient is included in each sub-block iscoded in the sub-block units.

Further, in NPL 1, the following coding is performed as follows inaccordance with a size of the transform unit (TU). In other words, inthe small TU (4×4 or 8×8), 4×4 or 8×2 is used as a sub-block size, and acontext which is assigned to a frequency component on the basis of aposition is derived. In the context derivation based on a position, acontext index (also referred to as a position context) which is definedin accordance with a position of a frequency component in a frequencydomain is assigned to the frequency component.

In addition, in the large TU (16×16, 32×32, 16×4, 4×16, 32×8, or 8×32),4×4 is used as a sub-block size, and a context which is assigned to afrequency component on the basis of periphery reference is derived. Inthe context derivation based on periphery reference, a context index(also referred to as a periphery reference context) which is defined inaccordance with the number of non-zero coefficients (that is,significant_coeff_flag is referred to) in peripheral frequencycomponents of a corresponding frequency component is assigned to thefrequency component.

In addition, NPL 2 discloses a technique for controlling whether or nota frequency transform process is skipped for each transform unit.Hereinafter, skipping of the frequency transform process is referred toas a transform skip.

Further, NPL 3 discloses a technique for controlling whether or not afrequency transform process or a quantization and loop filter processare skipped for each coding unit. Hereinafter, skipping of the frequencytransform and quantization processes is referred to as atransform/quantization bypass. The transform/quantization bypass ismainly used for lossless coding. For this reason, the skipping of thefrequency transform and quantization processes may not be referred to asa transform/quantization bypass but is simply referred to as a losslessmode.

CITATION LIST Non Patent Literature

-   NPL 1: “Suggested bug-fixes for HEVC text specification draft6    (JCTVC-I0030)”, Joint Collaborative Team on Video Coding (JCT-VC) of    ITU-T SG16 WP3 and ISO/IEC JTC1/SC29/WG11 9th Meeting: Geneva, CH,    27 Apr. to 7 May 2012 (published in April, 2012)-   NPL 2: #Transform Skipping (JCTVC-I0408) “Intra transform skipping    (JCTVC-I0408)”, Joint Collaborative Team on Video Coding (JCT-VC) of    ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11 9th Meeting: Geneva,    CH, 27 Apr. to 7 May 2012 (published in April, 2012)

NPL 3: #cu_transquant_bypass_flag (JCTVC-I0529) “AHG 13: Proposed bugfixfor tickets 410 and 470 related to lossless coding (JCTVC-I0529)”, JointCollaborative Team on Video Coding (JCT-VC) of ITU-T SG 16 WP 3 andISO/IEC JTC 1/SC 29/WG 11 9th Meeting: Geneva, CH, 27 Apr. to 7 May 2012(published in April, 2012)

SUMMARY OF INVENTION Technical Problem

However, in the above-described related art, since contexts of a flagindicating whether or not a non-zero coefficient is present or flags (aGR1 flag and a GR2 flag) indicating whether or not a level value is aspecific value are not the same in TU or a sub-block in a case where thetransform skip or the transform/quantization bypass is applied, there isa problem in that a reduction in a processing amount related to codingand decoding of transform coefficients is not sufficient. In addition,there is a problem in that a process for performing sign hiding in whichsigns of some coefficients are not decoded in the transform skip isnecessary.

Further, in a case where the transform skip and thetransform/quantization bypass are applied, there is a tendency for anappearance probability of coefficients in a TU or a sub-block to be thesame, but, in the related art, a context is changed depending on aposition of a transform coefficient and thus there is a problem in thatcoding efficiency is not sufficient.

Furthermore, in a case where the same context is used in a sub-block inthe lossless mode, there is a problem in that the number of contextindexes increases.

In addition, in a case where sign hiding is performed in the transformskip, there is a problem in that in coding efficiency is reduced due tothe sign hiding. There is a problem in that a reduction in a processingamount of coding and decoding of transform coefficients is notsufficient.

The present invention has been made in consideration of theabove-described problems, and an object thereof is to implement anarithmetic decoding device, an arithmetic coding device, and the likecapable of reducing a processing amount related to coding and decodingof a transform coefficient and improving coding efficiency when comparedwith the configuration of the related art.

Solution to Problem

In order to solve the above-described problems, according to an aspectof the present invention, there is provided an arithmetic decodingdevice which decodes coded data which is obtained by arithmeticallycoding various syntaxes indicating a transform coefficient with respectto each transform coefficient which is obtained for each frequencycomponent by performing frequency transform on a target image for eachunit domain and each transform coefficient in a pixel domain, obtainedthrough a transform skip, the device including sub-block splitting meansfor splitting a target frequency domain or a target pixel domaincorresponding to a process target unit domain target into sub-blockseach having a predetermined size; sub-block coefficient presence/absenceflag decoding means for decoding a sub-block coefficientpresence/absence flag indicating whether or not at least one non-zerocoefficient is included in the sub-block with respect to the respectivesub-blocks into which the frequency domain or the pixel domain is splitby the sub-block splitting means; and non-zero coefficientpresence/absence flag decoding means for decoding a non-zero coefficientpresence/absence flag indicating whether or not a transform coefficientin each of the sub-blocks is 0, in which the non-zero coefficientpresence/absence flag decoding means derives separate context indexesfor each of a non-zero coefficient presence/absence flag correspondingto each transform coefficient in the pixel domain, obtained through thetransform skip and a non-zero coefficient presence/absence flagcorresponding to each transform coefficient which is obtained for eachfrequency component through the frequency transform.

In a case where the transform skip is performed, a decoding targetcoefficient presence/absence flag is a non-zero coefficient in a pixeldomain. Since an appearance probability of a non-zero coefficient ateach coefficient position in a pixel domain and an appearanceprobability of a non-zero coefficient at each coefficient position in afrequency domain are different from each other, it is preferable todifferentiate contexts regarding coefficient presence/absence flags fromeach other in the pixel domain and the frequency domain.

According to the configuration, in a case where at least the transformskip is performed, it is possible to derive a context index which issuitable for a non-zero coefficient in a pixel domain. For this reason,since a code amount of a non-zero coefficient can be reduced in a TUwhich is a coding and decoding target, it is possible to reduce aprocessing amount related to decoding of the non-zero coefficient andalso to improve coding efficiency.

In the arithmetic decoding device according to the aspect of the presentinvention, the non-zero coefficient presence/absence flag decoding meansmay derive a fixed context index in a transform block in relation to anon-zero coefficient presence/absence flag corresponding to eachtransform coefficient in the pixel domain, obtained through thetransform skip.

In the arithmetic decoding device according to the aspect of the presentinvention, the non-zero coefficient presence/absence flag decoding meansmay derive a value based on a transform block size as a context index,in relation to a non-zero coefficient presence/absence flagcorresponding to each transform coefficient in the pixel domain,obtained through the transform skip.

Also in a pixel domain, since appearance probabilities of a non-zerocoefficient are different depending on a TU size, it is preferable todifferentiate contexts regarding coefficient presence/absence flags fromeach other for respective TU sizes. According to the configuration, itis possible to derive a context index which is suitable for a non-zerocoefficient in the pixel domain for each TU size. For this reason, sincea code amount of a non-zero coefficient can be further reduced in a TUwhich is a coding and decoding target, it is possible to reduce aprocessing amount related to decoding of the non-zero coefficient andalso to improve coding efficiency.

In the arithmetic decoding device according to the aspect of the presentinvention, the non-zero coefficient presence/absence flag decoding meansmay derive a predetermined context index on the basis of a predictiontype and a transform block size, in relation to a non-zero coefficientpresence/absence flag corresponding to each transform coefficient in thepixel domain, obtained through the transform skip.

In a case where the transform skip is performed, since appearanceprobabilities of a non-zero coefficient in a decoding target pixeldomain are different from each other in intra-prediction andinter-prediction, it is preferable to differentiate contexts regardingcoefficient presence/absence flags from each other for respectiveprediction types. According to the configuration, it is possible toderive a context index suitable for a non-zero coefficient in a pixeldomain for each prediction type and each TU size. For this reason, sincea code amount of a non-zero coefficient can be reduced in a TU which isa coding and decoding target, it is possible to reduce a processingamount related to decoding of the non-zero coefficient and also toimprove coding efficiency.

In the arithmetic decoding device according to the aspect of the presentinvention, the non-zero coefficient presence/absence flag decoding meansmay derive separate context indexes for each of a non-zero coefficientpresence/absence flag during the transform skip and a non-zerocoefficient presence/absence flag during a transform/quantizationbypass, in relation to the non-zero coefficient presence/absence flagcorresponding to each transform coefficient in the pixel domain,obtained through the transform skip or the transform/quantizationbypass.

Generally, since appearance probabilities of a non-zero coefficient in apixel domain are different from each other in the transform skip and thetransform/quantization bypass, it is preferable to differentiatecontexts regarding coefficient presence/absence flags from each other.According to the configuration, it is possible to derive a context indexwhich is suitable for a non-zero coefficient in a pixel domain for eachof the transform skip and the transform/quantization bypass. For thisreason, since a code amount of a non-zero coefficient can be reduced ina TU which is a coding and decoding target, it is possible to reduce aprocessing amount related to decoding of the non-zero coefficient andalso to improve coding efficiency.

The arithmetic decoding device according to the aspect of the presentinvention may further include GR1 flag decoding means for decoding a GR1flag indicating whether or not an absolute value of a transformcoefficient in each of the sub-blocks exceeds 1, and the GR1 flagdecoding means may derive separate context indexes for each of a GR1flag corresponding to each transform coefficient in the pixel domain,obtained through the transform skip and a GR1 flag corresponding to eachtransform coefficient which is obtained for each frequency componentthrough the frequency transform.

In a case where the transform skip is performed, a decoding target GR1flag is a GR1 flag in a pixel domain. Since an appearance probability ofa GR1 flag at each coefficient position in a pixel domain and anappearance probability of a GR1 flag at each coefficient position in afrequency domain are different from each other, it is preferable todifferentiate contexts regarding GR1 flags from each other in the pixeldomain and the frequency domain.

According to the configuration, in a case where at least the transformskip is performed, it is possible to derive a context index which issuitable for a GR1 flag in a pixel domain. For this reason, since a codeamount of a GR1 flag can be reduced in a TU which is a coding anddecoding target, it is possible to reduce a processing amount related todecoding of the GR1 flag and also to improve coding efficiency.

In the arithmetic decoding device according to the aspect of the presentinvention, the GR1 flag decoding means may derive a value based on atransform block size as a context index, in relation to a GR1 flagcorresponding to each transform coefficient in the pixel domain,obtained through the transform skip.

Also in a pixel domain, since appearance probabilities of a GR1 flag aredifferent depending on a TU size, it is preferable to differentiatecontexts regarding GR1 flags from each other for respective TU sizes.According to the configuration, it is possible to derive a context indexwhich is suitable for a GR1 flag in the pixel domain for each TU size.For this reason, since a code amount of a GR1 flag can be furtherreduced in a TU which is a coding and decoding target, it is possible toreduce a processing amount related to decoding of the GR1 flag and alsoto improve coding efficiency.

In the arithmetic decoding device according to the aspect of the presentinvention, the GR1 flag decoding means may derive a predeterminedcontext index on the basis of a prediction type and a transform blocksize, in relation to a GR1 flag corresponding to each transformcoefficient in the pixel domain, obtained through the transform skip.

In a case where the transform skip is performed, since appearanceprobabilities of a decoding target GR1 flag in a pixel domain aredifferent from each other in intra-prediction and inter-prediction, itis preferable to differentiate contexts regarding GR1 flags from eachother for respective prediction types. According to the configuration,it is possible to derive a context index suitable for a GR1 flag in apixel domain for each prediction type and each TU size. For this reason,since a code amount of a GR1 flag can be reduced in a TU which is acoding and decoding target, it is possible to reduce a processing amountrelated to decoding of the GR1 flag and also to improve codingefficiency.

In the arithmetic decoding device according to the aspect of the presentinvention, the GR1 flag decoding means may derive separate contextindexes for each of a GR1 flag during the transform skip and a GR1 flagduring a transform/quantization bypass, in relation to the GR1 flagcorresponding to each transform coefficient in the pixel domain,obtained through the transform skip or the transform/quantizationbypass.

Generally, since appearance probabilities of a decoding target GR1 flagin a pixel domain are different from each other in the transform skipand the transform/quantization bypass, it is preferable to differentiatecontexts regarding GR1 flags from each other for respective predictiontypes. According to the configuration, it is possible to derive acontext index which is suitable for a GR1 flag in a pixel domain foreach of the transform skip and the transform/quantization bypass. Forthis reason, since a code amount of a GR1 flag can be reduced in a TUwhich is a coding and decoding target, it is possible to reduce aprocessing amount related to decoding of the GR1 flag and also toimprove coding efficiency.

The arithmetic decoding device according to the aspect of the presentinvention may further include GR2 flag decoding means for decoding a GR2flag indicating whether or not an absolute value of a transformcoefficient in each of the sub-blocks exceeds 2, and the GR2 flagdecoding means may derive separate context indexes for at least eachtransform coefficient in the pixel domain, obtained through thetransform skip and each transform coefficient which is obtained for eachfrequency component through the frequency transform.

In a case where the transform skip is performed, a decoding target GR2flag is a GR2 flag in a pixel domain. Since an appearance probability ofa GR2 flag at each coefficient position in a pixel domain and anappearance probability of a GR2 flag at each coefficient position in afrequency domain are different from each other, it is preferable todifferentiate contexts regarding GR2 flags from each other in the pixeldomain and the frequency domain.

According to the configuration, in a case where the transform skip isperformed, it is possible to derive a context index which is suitablefor a GR2 flag in a pixel domain. For this reason, since a code amountof a GR2 flag can be reduced in a TU which is a coding and decodingtarget, it is possible to reduce a processing amount related to decodingof the GR2 flag and also to improve coding efficiency.

In the arithmetic decoding device according to the aspect of the presentinvention, the GR2 flag decoding means may derive a value based on atransform block size as a context index, in relation to a GR2 flagcorresponding to each transform coefficient in the pixel domain,obtained through the transform skip.

Also in a pixel domain, since appearance probabilities of a GR2 flag aredifferent depending on a TU size, it is preferable to differentiatecontexts regarding GR2 flags from each other for respective TU sizes.According to the configuration, it is possible to derive a context indexwhich is suitable for a GR2 flag in the pixel domain for each TU size.For this reason, since a code amount of a GR2 flag can be furtherreduced in a TU which is a coding and decoding target, it is possible toreduce a processing amount related to decoding of the GR2 flag and alsoto improve coding efficiency.

In the arithmetic decoding device according to the aspect of the presentinvention, the GR2 flag decoding means may derive a predeterminedcontext index on the basis of a prediction type and a transform blocksize, in relation to a GR2 flag corresponding to each transformcoefficient in the pixel domain, obtained through the transform skip.

In a case where the transform skip is performed, since appearanceprobabilities of a decoding target GR2 in a pixel domain are differentfrom each other in intra-prediction and inter-prediction, it ispreferable to differentiate contexts regarding GR2 flags from each otherfor respective prediction types. According to the configuration, it ispossible to derive a context index suitable for a GR2 flag in a pixeldomain for each prediction type and each TU size. For this reason, sincea code amount of a GR2 flag can be reduced in a TU which is a coding anddecoding target, it is possible to reduce a processing amount related todecoding of the GR2 flag and also to improve coding efficiency.

In the arithmetic decoding device according to the aspect of the presentinvention, the GR2 flag decoding means may derive separate contextindexes for each of a GR2 flag during the transform skip and a GR2 flagduring a transform/quantization bypass, in relation to the GR2 flagcorresponding to each transform coefficient in the pixel domain,obtained through the transform skip or the transform/quantizationbypass.

Generally, since appearance probabilities of a GR2 flag in a pixeldomain are different from each other in the transform skip and thetransform/quantization bypass, it is preferable to differentiatecontexts regarding GR2 flags from each other. According to theconfiguration, it is possible to derive a context index which issuitable for a GR2 flag in a pixel domain for each of the transform skipand the transform/quantization bypass. For this reason, since a codeamount of a GR2 flag can be reduced in a TU which is a coding anddecoding target, it is possible to reduce a processing amount related todecoding of the GR2 flag and also to improve coding efficiency.

In order to solve the above-described problems, according to anotheraspect of the present invention, there is provided an arithmeticdecoding device which decodes coded data which is obtained byarithmetically coding various syntaxes indicating a transformcoefficient with respect to each transform coefficient which is obtainedfor each frequency component by performing frequency transform on atarget image for each unit domain and each transform coefficient in apixel domain, obtained through a transform skip or atransform/quantization bypass, the device including coefficient signdecoding means for deriving a sign of a transform coefficient on whichsign hiding is performed, by using an absolute value of a transformcoefficient whose sign has been decoded or a sum of absolute values oftransform coefficients whose signs have been decoded, and for deriving asign of a transform coefficient on which the sign hiding is notperformed, by decoding a syntax from coded data; and sign hiding flagderiving means for deriving a sign hiding flag used to determine whetheror not the sign hiding is to be performed, on the basis of a transformskip flag, a transform/quantization bypass flag, and a differencebetween positions of decoded non-zero coefficients in a targetsub-block, or through comparison between the number of decoded non-zerocoefficients in the target sub-block and a predetermined thresholdvalue.

In a case where the transform skip is performed, or thetransform/quantization bypass is performed, performing sign hiding whichis accompanied by correction of a coefficient level value on acoefficient of a pixel domain may possibly cause deterioration insubjective image quality, and thus the sign hiding is preferablyprohibited. As mentioned above, in this configuration, by prohibitingsign hiding in the transform skip or the transform/quantization bypass,it is possible to improve subjective image quality.

In order to solve the above-described problems, according to stillanother aspect of the present invention, there is provided an imagedecoding apparatus including the arithmetic decoding device; inversefrequency transform means for generating a residual image by performinginverse frequency transform on a transform coefficient which is decodedby the arithmetic decoding device; and decoded image generating meansfor generating a decoded image by adding the residual image generated bythe inverse frequency transform means to a predicted image which ispredicted from a generated decoded image.

In order to solve the above-described problems, according to stillanother aspect of the present invention, there is provided an arithmeticcoding device which generates coded data by arithmetically codingvarious syntaxes indicating a transform coefficient with respect to eachtransform coefficient which is obtained for each frequency component byperforming frequency transform on a target image for each unit domainand each transform coefficient in a pixel domain, obtained through atransform skip, the device including sub-block splitting means forsplitting a target frequency domain corresponding to a process targetunit domain into sub-blocks each having a predetermined size; sub-blockcoefficient presence/absence flag coding means for coding a sub-blockcoefficient presence/absence flag indicating whether or not at least onenon-zero coefficient is included in the sub-block with respect to therespective sub-blocks into which the frequency domain is split by thesub-block splitting means; and non-zero coefficient presence/absenceflag coding means for coding a non-zero coefficient presence/absenceflag indicating whether or not a transform coefficient in each of thesub-blocks is 0, in which the non-zero coefficient presence/absence flagcoding means uses separate context indexes for each of a non-zerocoefficient presence/absence flag corresponding to each transformcoefficient in the pixel domain, obtained through the transform skip anda non-zero coefficient presence/absence flag corresponding to eachtransform coefficient which is obtained for each frequency componentthrough the frequency transform.

In order to solve the above-described problems, according to stillanother aspect of the present invention, there is provided an imagecoding apparatus including transform coefficient generating means forgenerating a transform coefficient by performing frequency transform ona residual image between a coding target image and a predicted image foreach unit domain; and the arithmetic coding device, in which thearithmetic coding device generates coded data by arithmetically codingvarious syntaxes indicating the transform coefficient which is generatedby the transform coefficient generating means.

Advantageous Effects of Invention

As described above, the arithmetic decoding device according to thepresent invention includes the sub-block splitting means for splitting atarget frequency domain or a target pixel domain corresponding to aprocess target unit domain into sub-blocks each having a predeterminedsize; the sub-block coefficient presence/absence flag decoding means fordecoding a sub-block coefficient presence/absence flag indicatingwhether or not at least one non-zero coefficient is included in thesub-block with respect to the respective sub-blocks into which thefrequency domain or the pixel domain is split by the sub-block splittingmeans; and the non-zero coefficient presence/absence flag decoding meansfor decoding a non-zero coefficient presence/absence flag indicatingwhether or not a transform coefficient in each of the sub-blocks is 0,in which the non-zero coefficient presence/absence flag decoding meansuses a fixed value in a TU or a sub-block as a context index withrespect to a transform coefficient in a process target transform blockon which the transform skip or the transform/quantization bypass isperformed. The fixed value may be derived as a value based on aprediction type and a TU size, and may be a fixed value regardless of aprediction type or a TU size.

By using a fixed value in a TU or a sub-block as a context index, it ispossible to reduce a processing amount related to decoding of a non-zerocoefficient and a level thereof. It is possible to derive a contextindex suitable for a non-zero coefficient in a pixel domain for eachprediction type and each TU size. For this reason, since a code amountof a non-zero coefficient can be further reduced in a TU which is acoding and decoding target, it is possible to achieve effects ofreducing a processing amount related to decoding of the non-zerocoefficient and also of improving coding efficiency.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating a configuration of a quantizedresidual information decoding unit included in a moving image decodingapparatus according to an embodiment of the present invention.

FIG. 2 illustrates data configuration of coded data which is generatedby the moving image coding apparatus according to the embodiment of thepresent invention and is decoded by the moving image decoding apparatus,in which FIGS. 2( a) to 2(d) are diagrams respectively illustrating apicture layer, a slice layer, a tree block layer, and a CU layer.

FIGS. 3( a) to 3(h) are diagrams illustrating a PU split type pattern,and respectively illustrate partition shapes in cases of 2N×2N, 2N×N,2N×nU, 2N×nD, N×2N, nL×2N, nR×2N, and NλN; FIGS. 3( i) to 3(o) arediagrams illustrating split methods in which a square node is subdividedinto square or non-square quadtrees in which FIG. 3( i) illustratessplit into square shapes, FIG. 3( j) illustrates split into rectangularshapes which are transversely long, FIG. 3( k) illustrates split intorectangular shapes which are longitudinally long, FIG. 3( l) illustratesthat a transversely long node is split into rectangular shapes which aretransversely long, FIG. 3( m) illustrates that a transversely long nodeis split into square shapes, FIG. 3( n) illustrates that alongitudinally long node is split into rectangular shapes which arelongitudinally long, and FIG. 3( o) illustrates that a longitudinallylong node is split into square shapes.

FIG. 4 is a diagram illustrating a first half part of a syntax tableindicating syntaxes included in quantized residual information of codeddata according to the embodiment.

FIG. 5 is a diagram illustrating a second half part of a syntax tableindicating syntaxes included in quantized residual information of codeddata according to the embodiment.

FIG. 6 illustrates a relationship between a block and a sub-block, inwhich FIG. 6( a) illustrates an example in which a 4×4 TU is formed by asingle sub-block including 4×4 components; FIG. 6( b) illustrates anexample in which an 8×8 TU is formed by four sub-blocks each including4×4 components; and FIG. 6( c) illustrates an example in which a 16×16TU is formed by sixteen sub-blocks each including 4×4 components.

FIG. 7 illustrates a scan order in a decoding process and a codingprocess according to the embodiment, in which FIG. 7( a) illustratesthat a sub-block scan is a forward scan, FIG. 7( b) illustrates that ascan in a sub-block is a forward scan, FIG. 7( c) illustrates that asub-block scan is a backward scan, and FIG. 7( d) illustrates that ascan in a sub-block is a backward scan.

FIG. 8 illustrates a decoding process of a non-zero coefficient in theembodiment in which FIG. 8( a) illustrates a scan order in a case wherea block having a TU size of 8×8 is split into sub-blocks each having asize of 4×4, and respective frequency components are scanned in aforward scan; FIG. 8( b) exemplifies transform coefficients (non-zerotransform coefficients) which are not 0 in a frequency domain includinga frequency component having a TU size of 8×8; FIG. 8( c) illustrateseach value of a sub-block coefficient presence/absence flagsignificant_coeff_group_flag which is decoded for each sub-block in acase where decoding target transform coefficients are ones illustratedin FIG. 8( b); FIG. 8( d) illustrates each value of syntaxsignificant_coeff_flag indicating the presence or absence of a non-zerocoefficient in a case where decoding target transform coefficients areones illustrated in FIG. 8( b); FIG. 8( e) illustrates an absolute valueof each transform coefficient obtained by decoding syntaxescoeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, andcoeff_abs_level_remaining in a case where decoding target transformcoefficients are ones illustrated in FIG. 8( b); and FIG. 8( f)illustrates a syntax coeff_sign_flag in a case where decoding targettransform coefficients are ones illustrated in FIG. 8( b).

FIG. 9 is a block diagram illustrating a configuration of the movingimage decoding apparatus according to the embodiment.

FIG. 10 is a block diagram illustrating a configuration of a variablelength code decoding unit included in the moving image decodingapparatus according to the embodiment.

FIG. 11 is a diagram illustrating directions of intra-prediction whichcan be used in the moving image decoding apparatus according to theembodiment.

FIG. 12 is a diagram illustrating intra-prediction modes and the namescorrelated with corresponding intra-prediction modes.

FIG. 13 is a table illustrating an example of a scan index scanIdxdesignated by an intra-prediction mode index IntraPredMode and eachvalue of log 2TrafoSize−2.

FIG. 14 illustrates a scan index, in which FIG. 14( a) illustrates ascan type ScanType designated by each value of the scan index scanIdx;FIG. 14( b) illustrates of a scan order in each of a horizontal fastscan, a vertical fast scan, and an up-right diagonal scan when a TU sizeis 4×4 components; and FIG. 14( c) illustrates another example of thehorizontal fast scan and the vertical fast scan.

FIG. 15 is a block diagram illustrating a configuration of a sub-blockcoefficient presence/absence flag decoding unit according to theembodiment.

FIG. 16 illustrates a decoding process performed by the sub-blockcoefficient presence/absence flag decoding unit according to theembodiment, in which FIG. 16( a) illustrates a target sub-block (xCG,yCG) and an adjacent sub-block (xCG, yCG+1) which is adjacent to thelower side of the target sub-block; FIG. 16( b) illustrates the targetsub-block (xCG, yCG) and an adjacent sub-block (xCG+1, yCG) which isadjacent to the right side of the target sub-block; and FIG. 16( c)illustrates the target sub-block (xCG, yCG), the adjacent sub-block(xCG, yCG+1) which is adjacent to the lower side of the targetsub-block, and the adjacent sub-block (xCG+1, yCG) which is adjacent tothe right side of the target sub-block.

FIG. 17 illustrates coding and decoding processes of a sub-blockcoefficient presence/absence flag according to the embodiment, in whichFIG. 17( a) illustrates transform coefficients which are present in afrequency domain of a 16×16 TU, and FIG. 17( b) illustrates a sub-blockcoefficient presence/absence flag assigned to each sub-block.

FIG. 18 is a block diagram illustrating a configuration of a coefficientpresence/absence flag decoding unit according to an embodiment.

FIG. 19 illustrates a decoding process of transform skip andtransform/quantization bypass flags, in which FIG. 19( a) illustratessyntax examples of the transform/quantization bypass flag and thetransform skip flag, and FIG. 19( b) is a flowchart specificallyillustrating the decoding process.

FIG. 20 illustrates a decoding process of transform skip andtransform/quantization bypass flags, in which FIG. 20( a) illustratessyntax examples of the transform/quantization bypass flag and thetransform skip flag, and FIG. 20( b) is a flowchart specificallyillustrating the decoding process.

FIG. 21 illustrates a decoding process of transform skip andtransform/quantization bypass flags of the related art, in which FIG.21( a) illustrates syntax examples of the transform/quantization bypassflag and the transform skip flag, and FIG. 21( b) is a flowchartspecifically illustrating the decoding process.

FIG. 22 is a diagram illustrating a context index deriving processaccording to the embodiment, in which FIG. 22( a) illustrates a contextindex which is derived for each frequency component included in afrequency domain having a TU size of 4×4 and which is referred to fordecoding significant_coeff_flag regarding luminance Y and chroma U andV, and FIG. 22( b) illustrates a context index which is derived for eachfrequency component included in a frequency domain having a TU size of8×8 and which is referred to for decoding significant_coeff_flagregarding luminance Y and chroma U and V.

FIG. 23 is a flowchart illustrating a flow of a process in which atransform coefficient decoding unit selects a scan type according to theembodiment.

FIG. 24 is a flowchart illustrating a flow of a process in which thetransform coefficient decoding unit according to the embodiment decodesa transform coefficient.

FIG. 25 is a flowchart illustrating a flow of a process in which thetransform coefficient decoding unit according to the embodiment decodesa sub-block coefficient presence/absence flag.

FIG. 26 is a flowchart illustrating a flow of a process in which thetransform coefficient decoding unit according to the embodiment decodeseach coefficient presence/absence flag significant_coeff_flag in asub-block.

FIG. 27 is a diagram illustrating a method of deriving a sub-block sizeby using CU prediction type information, a TU size, and anintra-prediction mode index IntraPredMode.

FIG. 28 is a diagram illustrating another example of a pseudo-code forderiving a context index from coordinates of a process target frequencycomponent in a sub-block according to a pattern index idxCG.

FIGS. 29( a)-29(d) illustrate arrangements of values of the contextindexes in the context index derivation method using the pseudo-codeillustrated in FIG. 28.

FIG. 30 is a flowchart illustrating a context deriving means selectingprocess performed by a context deriving means selecting part.

FIG. 31 illustrates a deriving process of a context index ctxIdx, inwhich FIG. 31( a) is a diagram illustrating a logarithmic value log2TrafoWidth of a TU width size, a logarithmic value log 2TrafoHeight ofa TU height size, and a corresponding relative context index tableTBL_CTX_IDX[log 2TrafoWidth−2][log 2TrafoHeight−2], and FIG. 31( b) is adiagram illustrating a logarithmic value log 2TrafoSize of a TU size anda relative context index table TBL_CTX_IDX[log 2TrafoSize−2].

FIG. 32 is a diagram illustrating a prediction type PredType, alogarithmic value log 2TrafoWidth of a TU width size, a logarithmicvalue log 2TrafoHeight of a TU height size, and a corresponding relativecontext index table TBL_CTX_IDX[log 2TrafoWidth−2][log 2TrafoHeight−2].

FIG. 33 is a diagram illustrating a prediction type PredType, alogarithmic value log 2TrafoSize of a TU size, and a relative contextindex table TBL_CTX_IDX[PredType][log 2TrafoSize−2].

FIG. 34 is a diagram illustrating an identifier index for identifying atransform skip and a quantization bypass, a logarithmic value log2TrafoSize of a TU size, and a relative context index tableTBL_CTX_IDX[PredType][log 2TrafoSize−2].

FIG. 35 is a flowchart illustrating a decoding process of a GR1 flag.

FIG. 36 is a flowchart illustrating a decoding process of a GR2 flag.

FIG. 37 is a flowchart illustrating a decoding process of a remainingcoefficient level.

FIG. 38 is a flowchart illustrating a coding process of a GR1 flag.

FIG. 39 is a flowchart illustrating a coding process of a GR2 flag.

FIG. 40 is a flowchart illustrating a coding process of a remainingcoefficient level.

FIG. 41 is a diagram illustrating a pseudo-code related to Example, forderiving a context index from coordinates of a process target frequencycomponent in a sub-block according to a pattern index idxCG.

FIGS. 42( a)-42(d) illustrate arrangements of values of the contextindexes in the context index derivation method using the pseudo-codeillustrated in FIG. 41.

FIG. 43 is a block diagram illustrating a configuration example of acoefficient value decoding unit.

FIG. 44 is a flowchart illustrating an operation of a coefficient signdecoding unit according to the embodiment.

FIG. 45 is a flowchart illustrating a flow of a sign hiding flagderiving process performed by a sign hiding flag deriving unit.

FIG. 46 is a block diagram illustrating another configuration example ofthe coefficient value decoding unit.

FIG. 47 is a flowchart illustrating a flow of a specific operation of asign computation process of sign hiding performed by a sign codederiving unit.

FIG. 48 is a flowchart illustrating an operation of the coefficient signdecoding unit in a case where a coefficient absolute value sum sumAbs isnot used.

FIG. 49 is a flowchart illustrating a flow of a specific operation of asign computation process of sign hiding performed by the sign codederiving unit in a configuration in which a coefficient absolute valuesum sumAbs is not used.

FIG. 50 is a block diagram illustrating a configuration of a movingimage coding apparatus according to the embodiment.

FIG. 51 is a block diagram illustrating a configuration of a variablelength code coding unit included in the moving image coding apparatusaccording to the embodiment.

FIG. 52 is a block diagram illustrating a configuration of a quantizedresidual information coding unit included in the moving image codingapparatus according to the embodiment of the present invention.

FIG. 53 illustrates a coding process of transform skip andtransform/quantization bypass flags, in which FIG. 53( a) illustratessyntax examples of the transform/quantization bypass flag and thetransform skip flag, and FIG. 53( b) is a flowchart specificallyillustrating the coding process.

FIG. 54 illustrates a coding process of transform skip andtransform/quantization bypass flags, in which FIG. 54( a) illustratessyntax examples of the transform/quantization bypass flag and thetransform skip flag, and FIG. 54( b) is a flowchart specificallyillustrating the coding process.

FIG. 55 illustrates a coding process of transform skip andtransform/quantization bypass flags of the related art, in which FIG.55( a) illustrates syntax examples of the transform/quantization bypassflag and the transform skip flag, and FIG. 55( b) is a flowchartspecifically illustrating the coding process.

FIG. 56 is a block diagram illustrating a second configuration exampleof the coefficient presence/absence flag coding unit according to theembodiment.

FIG. 57 is a block diagram illustrating a configuration of a sub-blockcoefficient presence/absence flag coding unit according to theembodiment.

FIG. 58 is a block diagram illustrating a configuration example of acoefficient value syntax deriving unit according to the embodiment.

FIG. 59 is a block diagram illustrating another configuration example ofthe coefficient presence/absence flag decoding unit.

FIG. 60 is a flowchart illustrating context deriving means selectingprocess performed by a context deriving means selecting part.

FIG. 61 is a block diagram illustrating another configuration example ofthe coefficient presence/absence flag coding unit.

FIG. 62 illustrates configurations of transmission equipment equippedwith the moving image coding apparatus and reception equipment equippedwith the moving image decoding apparatus, in which FIG. 62( a)illustrates the transmission equipment equipped with the moving imagecoding apparatus, and FIG. 62( b) illustrates the reception equipmentequipped with the moving image decoding apparatus.

FIG. 63 illustrates configurations of recording equipment equipped withthe moving image coding apparatus and reproducing equipment equippedwith the moving image decoding apparatus, in which FIG. 63( a)illustrates the recording equipment equipped with the moving imagecoding apparatus, and FIG. 63( b) illustrates the reproducing equipmentequipped with the moving image decoding apparatus.

DESCRIPTION OF EMBODIMENTS

A coding apparatus and a decoding apparatus according to an embodimentof the present invention will be described. In addition, the decodingapparatus according to the embodiment decodes a moving image from codeddata. Therefore, hereinafter, this is referred to as a “moving imagedecoding apparatus”. Further, the coding apparatus according to thepresent embodiment generates coded data by coding a moving image.Therefore, hereinafter, this is referred to as a “moving image codingapparatus”.

However, the scope to which the present invention is applicable is notlimited thereto. In other words, as is clear from the followingdescription, features of the present invention are established even if aplurality of frames are not premised. That is, the present invention isgenerally applicable to a decoding apparatus and a coding apparatusregardless of whether a target is a moving image or a still image.

(Configuration of Coded Data #1)

With reference to FIG. 2, a configuration example of coded data #1 whichis generated by a moving image coding apparatus 2 and is decoded by amoving image decoding apparatus 1 will be described. The coded data #1exemplarily includes a sequence and a plurality of pictures forming thesequence.

In a sequence layer, sets of data which are referred to by the movingimage decoding apparatus 1 in order to decode a process target sequenceare prescribed. The sequence layer includes a sequence parameter setSPS, a picture parameter set PPS, and a picture PICT.

FIG. 2 illustrates structures of hierarchies which are equal to or lowerthan a picture layer in the coded data #1. FIGS. 2( a) to 2(d) arediagrams respectively illustrating a picture layer which prescribes thepicture PICT, a slice layer which prescribes a slice S, a tree blocklayer which prescribes a tree block TBLK, and a CU layer whichprescribes a coding unit (CU) included in the tree block TBLK.

(Picture Layer)

In the picture layer, sets of data which are referred to by the movingimage decoding apparatus 1 in order to decode a process target picturePICT (hereinafter, also referred to as a target picture) are prescribed.The picture PICT includes a picture header PH and slices S1 to SNS(where NS indicates a total number of slices included in the picturePICT) as illustrated in FIG. 2( a).

In addition, in the following, in a case where the respective slices S1to SNS are not required to be differentiated from each other, thesubscripts may be omitted. Further, this is also the same for other datawhich is included in the coded data #1 described below and is given asubscript.

The picture header PH includes a coding parameter group which isreferred to by the moving image decoding apparatus 1 in order todetermine a decoding method of a target picture. As coding parametersincluded in the picture header PH, there are, for example, atransform/quantization bypass enabled flag (transqunat_bypass_enabled_flag) indicating whether or not a flag(cu_transqunat_bypass_flag; transform/quantization bypass flag) isexplicitly decoded from coded data, in which the transform/quantizationbypass flag indicates whether or not inverse quantization and inversefrequency transform processes are skipped for each coding unit (CU), anda transform skip enabled flag (transform skip enabled flag) indicatingwhether or not a flag (transform skip flag; transform skip flag) isexplicitly decoded from coded data, in which the transform skip flagindicates whether or not an inverse frequency transform process isskipped for each transform unit (TU).

In addition, since the transform/quantization bypass is mainly used in alossless mode, the transform/quantization bypass flag may not bereferred to as a transform/quantization bypass flag but be referred toas a lossless flag (cu_lossless_flag). Further, thetransform/quantization bypass enabled flag and the transform skipenabled flag may be described not in the picture header PH but in acoding parameter of a higher layer (a sequence parameter set SPS or apicture parameter set PPS) or a lower layer (a slice header SH).

(Slice Layer)

In the slice layer, sets of data which are referred to by the movingimage decoding apparatus 1 in order to decode a process target slice S(hereinafter, also referred to as a target slice) are prescribed. Theslice S includes a slice header SH and tree blocks TBLK₁ to TBLK_(NC)(where NC indicates a total number of tree blocks included in the sliceS) as illustrated in FIG. 2( b).

The slice header SH includes a coding parameter group which is referredto by the moving image decoding apparatus 1 in order to determine adecoding method of a target slice. Slice type designation information(slice_type) for designating a slice type is an example of a codingparameter included in the slice header SH.

Slice types which can be designated by the slice type designationinformation may include (1) an I slice which uses only intra-predictionduring coding, (2) a P slice which uses a uni-prediction orintra-prediction during coding, (3) a B slice which uses uni-prediction,bi-prediction, or intra-prediction, and the like.

In addition, the slice header SH includes a filter parameter FP which isreferred to by a loop filter which is included in the moving imagedecoding apparatus 1. The filter parameter FP includes a filtercoefficient group. The filter coefficient group includes (1) tap numberdesignation information for designating the number of taps of filters,(2) filter coefficients a0 to aNT−1 (where NT indicates a total numberof filter coefficients included in the filter coefficient group), and(3) an offset.

(Tree Block Layer)

In the tree block layer, sets of data which are referred to by themoving image decoding apparatus 1 in order to decode a process targettree block TBLK (hereinafter, also referred to as a target tree block)are prescribed.

The tree block TBLK includes a tree block header TBLKH and coding unitinformation CU₁ to CU_(NL) (where NL indicates a total number of itemsof coding unit information included in the tree block TBLK). Here,first, a description will be made of a relationship between the treeblock TBLK and the coding unit information CU.

The tree block TBLK is split into units for specifying a block size usedfor each process of intra-prediction or inter-prediction and transform.

The units of the tree block TBLK are obtained through recursive quadtreesubdivision. A tree structure obtained through the recursive quadtreesubdivision is hereinafter referred to as a coding tree.

Hereinafter, a unit corresponding to a leaf which is a terminal node ofthe coding tree is referred to as a coding node. In addition, the codingnode is a basic unit in a coding process, and thus the coding node ishereinafter referred to as a coding unit (CU).

In other words, the coding unit information CU₁ to CU_(NL) isinformation corresponding to each coding node (coding unit) which isobtained by performing recursive quadtree subdivision on the tree blockTBLK.

In addition, a root of the coding tree is correlated with the tree blockTBLK. In other words, the tree block TBLK is correlated with the highestnode of a tree structure obtained through quadtree subdivision,recursively including a plurality of coding nodes.

In addition, a size of each coding node is a half of a size of a codingnode (that is, a unit of a one hierarchy higher node of thecorresponding coding node) vertically and horizontally, to which thecorresponding coding node directly belongs.

Further, a size taken by each coding node depends on size designationinformation and a maximum hierarchical depth of a coding node, includedin the sequence parameter set SPS of the coded data #1. For example, ina case where a size of the tree block TBLK is 64×64 pixels, and themaximum hierarchical depth is 3, a coding node in a hierarchy which isequal to or lower than the tree block TBLK can take any one of fourtypes of sizes, that is, 64×64 pixels, 32×32 pixels, 16×16 pixels, and8×8 pixels.

(Tree Block Header)

Tree block header TBLKH includes coding parameters which are referred toby the moving image decoding apparatus 1 in order to determine adecoding method of a target tree block. Specifically, as illustrated inFIG. 2( c), tree block split information SP_TBLK for designating a splitpattern of a target tree block into respective CUs, and a quantizationparameter difference Δqp (qp_delta) for designating a size of aquantization step, are included.

The tree block split information SP_TBLK is information indicating acoding tree for splitting a tree block, and, specifically, informationfor designating a shape, size, and a position in a target tree block, ofeach CU included in the target tree block.

In addition, the tree block split information SP_TBLK may not explicitlyinclude a shape or a size of a CU. For example, the tree block splitinformation SP_TBLK may be a set of flags (split_coding_unit_flag)indicating the entire target tree block or a partial domain of a treeblock is split into four parts. In this case, a shape or a size of eachCU can be specified by using a shape or a size of a tree block together.

In addition, the quantization parameter difference Δqp is a differenceqp−qp′ between a quantization parameter qp in a target tree block and aquantization parameter qp′ in a tree block which is coded right beforethe corresponding target tree block.

(CU Layer)

In the CU layer, sets of data which are referred to by the moving imagedecoding apparatus 1 in order to decode a process target CU(hereinafter, also referred to as a target CU) are prescribed.

Here, prior to detailed description of content of data included in thecoding unit information CU, a tree structure of data included in the CUwill be described. A coding node is a node of roots of a prediction tree(PT) and a transform tree (TT). The prediction tree and the transformtree will be described.

In the prediction tree, a coding node is split into one or a pluralityof prediction blocks, and a position and a size of each prediction blockare prescribed. In other words, the prediction block is one domain or aplurality of domains which do not overlap each other, forming the codingnode. In addition, the prediction tree includes one or a plurality ofprediction blocks obtained through the above-described splitting.

A prediction process is performed for each prediction block.Hereinafter, the prediction block which is the unit of prediction isalso referred to as a prediction unit (PU).

Types of splits in the prediction tree roughly include two types ofintra-prediction and inter-prediction.

In a case of intra-prediction, as a split method, there are 2N×2N (whichis the same size as that of a coding node) and N×N.

In addition, in a case of inter-prediction, as a split method, there are2N×2N (which is the same size as that of a coding node), 2N×N, N×2N,N×N, and the like.

Further, in the transform tree, a coding node is split into one or aplurality of transform blocks, and a position and a size of eachtransform block are prescribed. In other words, the transform block isone domain or a plurality of domains which do not overlap each other,forming the coding node. In addition, the transform tree includes one ora plurality of transform blocks obtained through the above-describedsplitting.

A transform process is performed for each prediction block. Hereinafter,the transform block which is the unit of transform is also referred toas a transform unit (TU). A size of the TU is represented by alogarithmic value log 2TrafoWidth of a width and a logarithmic value log2TrafoHeight of a height of a transform block. A size of the TU is alsorepresented by a value log 2TrafoSize obtained from the followingequation.

log 2TrafoSize=(log 2TrafoWidth+log 2TrafoHeight)>>1

Hereinafter, a TU having a width W×height H is referred to as W×H TU(for example, 4×4 TU).

(Data Structure of Coding Unit Information)

Next, with reference to FIG. 2( d), detailed description will be made ofcontent of data included in the coding unit information CU. Asillustrated in FIG. 2( d), the coding unit information CU includes,specifically, a transform/quantization bypass flag(transquant_bypass_flag; also abbreviated to TBF), a skip mode flagSKIP, CU prediction type information Pred_type, PT information PTI, andTT information TTI.

[Transform/Quantization Bypass Flag]

The transform/quantization bypass flag transquant_bypass_flag is a flagindicating whether or not inverse quantization and inverse transform areapplied to each TU included in a target CU. In a case where a value ofthe transform/quantization bypass flag is 1, inverse quantization andinverse transform processes are skipped with respect to each TU includedin the target CU. In addition, in a case where a value oftransquant_bypass_enable_flag is 1, the transform/quantization bypassflag transquant_bypass_flag is explicitly coded (decoded). On the otherhand, in a case where a value of transquant_bypass_enable_flag is 0,coding (decoding) of a syntax of the transform/quantization bypass flagis omitted, and a value of the transform/quantization bypass flag isinterpreted as 0 (transqunt_by pass_flag==0). Further, thetransform/quantization bypass flag may be coded (decoded) not in a CUlayer but for each transform unit (TU) which is a lower layer.

[Skip Flag]

The skip flag SKIP is a flag indicating whether or not a skip mode isapplied to a target CU, and in a case where a value of the skip flagSKIP is 1, that is, the skip mode is applied to a target CU, the PTinformation PTI in the coding unit information CU is omitted. Inaddition, the skip flag SKIP is omitted in an I slice.

[CU Prediction Type Information]

The CU prediction type information Pred_type includes CU predictionmethod information PredMode and PU split type information PartMode. TheCU prediction type information is simply referred to as prediction typeinformation in some cases.

The CU prediction method information PredMode is to designate one ofintra-prediction (intra-CU) and inter-prediction (inter-CU) as apredicted image generation method for each PU included in a target CU.In addition, hereinafter, the types of skip, intra-prediction, andinter-prediction are referred to as CU prediction modes in a target CU.

The PU split type information PartMode is to designate a PU split typewhich is a pattern of split of a target coding unit (CU) into PUs.Hereinafter, as mentioned above, splitting target coding unit (CU) intoPUs according to a PU split type is referred to as PU split.

For example, the PU split type information PartMode may be an indexindicating the type of PU split pattern, and may designate a shape, asize, and a position in a target prediction tree, of each PU included inthe target prediction tree.

In addition, a selectable PU split type is different depending on a CUprediction type and a CU size. Further, a selectable PU split type isdifferent in each case of inter-prediction and intra-prediction.Furthermore, details of the PU split type will be described later.

[PT Information]

The PT information PTI is information regarding a PT included in atarget CU. In other words, the PT information PTI is a set ofinformation regarding each of one or a plurality of PUs included in aPT. As described above, generation of a predicted image is performed inthe units of PUs, and thus the PT information PTI is referred to whenthe predicted image is generated by the moving image decoding apparatus1. The PT information PTI includes PU information PUI₁ to PUI_(NP)(where NP indicates a total number of PUs included in a target PT)including prediction information in each PU as illustrated in FIG. 2(d).

The prediction information PUI includes an intra-prediction parameterPP_Intra or an inter-prediction parameter PP_Inter according to aprediction type designated by the prediction type information Pred_mode.Hereinafter, a PU to which intra-prediction is applied is referred to asan intra-PU, and a PU to which inter-prediction is applied is referredto as an inter-PU.

The inter-prediction parameter PP_Inter includes coding parameters whichare referred to when the moving image decoding apparatus 1 generates aninter-predicted image through inter-prediction.

The inter-prediction parameter PP_Inter may be, for example, a mergeflag (merge_flag), a merge index (merge_idx), an estimated motion vectorindex (mvp_idx), a reference image index (ref_idx), an inter-predictionflag (inter_pred_flag), and a motion vector difference (mvd).

The intra-prediction parameter PP_Intera includes coding parameterswhich are referred to when the moving image decoding apparatus 1generates an intra-predicted image through intra-prediction.

The intra-prediction parameter PP_Intra may be, for example, anestimated prediction mode flag, an estimated prediction mode index, anda remaining prediction mode index.

In addition, the intra-prediction parameter may include a PCM mode flagindicating whether or not a PCM mode is used. In a case where the PCMmode flag is coded, and the PMC mode flag indicates that a PCM mode isused, each of a prediction process (intra), a transform process, and anentropy coding process is omitted.

[TT Information]

The TT information TTI is information regarding a TT included in a CU.In other words, the TT information TTI is a set of information regardingeach of one or a plurality of TUs included in a TT, and is referred towhen the moving image decoding apparatus 1 decodes residual data. Inaddition, hereinafter, a TU is referred to as a block in some cases.

As illustrated in FIG. 2( d), the TT information TTI includes TT splitinformation SP_TU for designating a split pattern of a target CU intotransform blocks, and TU information TUI₁ to TUI_(NT) (where NTindicates a total number of blocks included in a target CU).

The TT split information SP_TU is, specifically, information fordetermining a shape, a size, and a position in a target CU, of each TUincluded in the target CU. For example, the TT split information SP_TUmay be realized by information (split_transform_flag) indicating whetheror not a target node will be split, and information (trafoDepth)indicating a depth of the split.

In addition, for example, in a case where a size of a CU is 64×64, eachTU which is obtained through splitting can take sizes of 32×32 pixels to4×4 pixels.

The TU information TUI₁ to TUI_(NT) is information regarding each of oneor a plurality of TUs included in a TT. For example, the TU informationTUI includes a quantized prediction residual (also referred to as aquantized residual).

Each quantized prediction residual is coded data which is generated bythe moving image coding apparatus 2 performing the following process A,B, or C on a process target block.

(Process A: Case where Frequency Transform and Quantization arePerformed in Order to Perform Variable Length Coding on a QuantizedTransform Coefficient)

Process A-1: Frequency transform (for example, discrete cosine transform(DCT)) is performed on a prediction residual obtained by subtracting apredicted image from a coding target image.

Process A-2: A transform coefficient obtained in the process A-1 isquantized.

Process A-3: Variable length coding is performed on the transformcoefficient quantized in the process A-2.

(Process B: Case where Frequency Transform is Skipped, Quantization isPerformed, and Variable Length Coding is Performed on a Value of aQuantized Prediction Residual (Case of a Transform Skip))

Process B-1: A prediction residual obtained by subtracting a predictedimage from a coding target image is quantized.

Process B-2: Variable length coding is performed on the predictionresidual (coefficient) quantized in the process B-1.

(Process C: Case where Frequency Transform and Quantization are Skipped,and Variable Length Coding is Performed on a Value of a PredictionResidual (Case of a Transform/Quantization Bypass))

Process C-1: Variable length coding is performed on a predictionresidual obtained by subtracting a predicted image from a coding targetimage.

Hereinafter, a transform coefficient of a prediction residual and acoefficient of the prediction residual are simply referred to as a“transform coefficient” without being differentiated from each other.

In addition, the quantization parameter qp indicates a size of aquantization step QP which is used for the moving image coding apparatus2 to quantize the transform coefficient (QP=2^(qP/6)).

(PU Split Type)

The PU split type includes a total of the following eight types ofpatterns assuming that a size of a target CU is 2N×2N. In other words,there are four symmetric splitting including 2N×2N pixels, 2N×N pixels,N×2N pixels, and N×N pixels, and four asymmetric splitting including2N×nU pixels, 2N×nD pixels, nL×2N pixels, and nR×2N pixels. In addition,N indicates 2m (where m is an integer of 1 or more). Hereinafter, adomain which is obtained by splitting a symmetric CU is also referred toas a partition.

FIGS. 3( a) to 3(h) specifically illustrate positions of boundaries ofPU slit in a CU, for respective slit types.

FIG. 3( a) illustrates a PU split type of 2N×2N in which a CU is notsplit. In addition, FIGS. 3( b), 3(c) and 3(d) respectively illustrateshapes of partitions in cases where PU split types are 2N×N, 2N×nU, and2N×nD. Further, FIGS. 3( e), 3(f) and 3(g) respectively illustrateshapes of partitions in cases where PU split types are N×2N, nL×2N, andnR×2N. Furthermore, FIG. 3( h) illustrates a shape of a partition in acase where a PU split type is N×N.

The PU split types of FIGS. 3( a) and 3(h) are also referred to assquare split on the basis of the shape of the partition. In addition,the PU split types of FIGS. 3( b) to 3(g) are also referred to asnon-square split.

Further, in FIGS. 3( a) to 3(h), a number given to each domain indicatesan identification number of the domain, and a process is performed onthe domains in an order of the identification numbers. In other words,the identification number indicates a scan order of the domain.

[Split Type in Case of Inter-Prediction]

In an inter-PU, seven types are defined except for N×N (FIG. 3( h))among the eight split types. In addition, the six asymmetric splittingsare referred to as asymmetric motion partition (AMP).

Further, a specific value of N is prescribed by a size of a CU to whicha corresponding PU belongs, and specific values of nU, nD, nL, and nRare determined according to a value of N. For example, an inter-CU of128×128 pixels can be split into inter-PUs of 128×128 pixels, 128×64pixels, 64×128 pixels, 64×64 pixels, 128×32 pixels, 128×96 pixels,32×128 pixels, and, and 96×128 pixels.

[Split Type in Case of Intra-Prediction]

The following two split patterns are defined in an intra-PU. Thepatterns are a split pattern 2N×2N in which a target CU is not split,that is, the target CU is treated as a single PU, and a pattern N×N inwhich the target CU is symmetrically split into four PUs.

Therefore, the intra-PU can take the split patterns of FIGS. 3( a) and3(h) in the examples illustrated in FIG. 3.

For example, an intra-CU of 128×128 pixels can be split into PUs of128×128 pixels and 64×64 pixels.

(TU Split Type)

Next, a TU split type will be described with reference to FIGS. 3( i) to3(o). Patterns of TU split are determined by a size of a CU, a depth(trafoDepth) of split, and a PU split type of a target PU.

In addition, patterns of TU split include square quadtree subdivisionand non-square quadtree subdivision.

FIGS. 3( i) to (k) illustrate split types in which a square node issubdivided into square or non-square quadtrees. More specifically, FIG.3( i) illustrates a split type in which a square node is subdivided intosquare quadtrees. In addition, FIG. 3( j) illustrates a split type inwhich a square node is subdivided into rectangular quadtrees each ofwhich is transversely long. Further, FIG. 3( k) illustrates a split typein which a square node is subdivided into rectangular quadtrees each ofwhich is longitudinally long.

In addition, FIGS. 3( l) to 3(o) illustrate split types in which anon-square node is subdivided into square or non-square quadtrees. Morespecifically, FIG. 3( l) illustrates a split type in which a rectangularnode which is transversely long is subdivided into rectangular quadtreeseach of which is transversely long. In addition, FIG. 3( m) illustratesa split type in which a rectangular node which is transversely long issubdivided into square quadtrees. Further, FIG. 3( n) illustrates asplit type in which a rectangular node which is longitudinally long issubdivided into rectangular quadtrees each of which is longitudinallylong. Furthermore, FIG. 3( o) illustrates a split type in which arectangular node which is longitudinally long is subdivided into squarequadtrees.

(Configuration of Quantized Residual Information QD)

The quantized residual information QD may include information such as aposition of the last non-zero coefficient, the presence or absence of anon-zero coefficient in a sub-block, the presence or absence of anon-zero coefficient at each position, and a level and a sign of atransform coefficient. For example, FIGS. 4 and 5 illustrate each syntaxincluded in the quantized residual information QD (in FIG. 4, denoted byresidual_coding_cabac( )).

FIG. 4 is a diagram illustrating a first half part of a syntax tablewhich shows syntaxes included in the quantized residual information QD.FIG. 5 is a diagram illustrating a second half part of the syntax tablewhich shows syntaxes included in the quantized residual information QD.

As illustrated in FIGS. 4 and 5, the quantized residual information QDmay include syntaxes transqunat_bypass_flag, transform_skip_flag,last_significant_coeff_x, last_significant_coeff_y,significant_coeff_group_flag, significant_coeff_flag,coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag,coeff_sign_flag, and coeff_abs_level_remaining.

Each syntax included in the quantized residual information QD is codedby context-based binary arithmetic coding (CABAC).

Transform coefficients are sequentially scanned from a low frequencyside toward a high frequency side. This scan order may be referred to asa forward scan. On the other hand, reversely to the forward scan, a scanfrom a high frequency side to a low frequency side is also used. Thisscan order may be referred to as a backward scan. In addition, in a casewhere a transform skip or a transform/quantization bypass is to beperformed, the forward scan and the backward scan are applied to a pixeldomain.

The syntaxes last_significant_coeff_x and last_significant_coeff_y aresyntaxes indicating a position of the last non-zero coefficient in theforward scan direction. In addition, each syntax may be subdivided intoprefix and suffix and be coded. A last coefficient position may bederived by using last coefficient position prefixeslast_significant_coeff_x_prefix and last_significant_coeff_y_prefix andlast coefficient position suffixes last_significant_coeff_x_suffix, andlast_significant_coeff_y_suffix.

The syntax significant_coeff_flag is a syntax indicating the presence orabsence of a non-zero coefficient in each frequency component in thebackward scan direction with a non-zero coefficient as a starting point.The syntax significant_coeff_flag is a flag which takes 0 if a transformcoefficient is 0 and takes 1 if a transform coefficient is not 0, withrespect to each of xC and yC. In addition, the syntaxsignificant_coeff_flag is also referred to as a coefficientpresence/absence flag. Further, significant_coeff_flag may not betreated as separate syntax but may be included in the syntaxcoeff_abs_level indicating an absolute value of a transform coefficient.In this case, a first bit of the syntax coeff_abs_level corresponds tosignificant_coeff_flag, and the following process of deriving a contextindex of significant_coeff_flag corresponds to a process of deriving acontext index of the first bit of the syntax coeff_abs_level.

A variable length code decoding unit 11 included in the moving imagedecoding apparatus 1 splits a tree block into a plurality of sub-blocks,and decodes significant_coeff_group_flag in the process units ofsub-blocks. The quantized residual information QD includes a flag(sub-block coefficient presence/absence flagsignificant_coeff_group_flag) indicating that at least one non-zerocoefficient is present in the sub-block in the sub-block units.

Hereinafter, with reference to FIGS. 6 to 8, a summary of a decodingprocess will be described.

FIG. 6 illustrates a relationship between a block and a sub-block. FIG.6( a) illustrates an example in which a 4×4 TU is formed by a singlesub-block including 4×4 components. FIG. 6( b) illustrates an example inwhich an 8×8 TU is formed by four sub-blocks each including 4×4components. FIG. 6( c) illustrates an example in which a 16×16 TU isformed by sixteen sub-blocks each including 4×4 components. In addition,a relationship between a TU size and a sub-block size and a splittingmethod are not limited to these examples.

FIG. 7( a) is a diagram illustrating a scan order for a plurality of (inFIG. 7( a), 4×4=16) sub-blocks obtained by splitting a block.Hereinafter, a scan in the units of sub-blocks is also referred to as asub-block scan. In a case where the sub-blocks are scanned as in FIG. 7(a), respective frequency domains in the sub-blocks are scanned in a scanorder illustrated in FIG. 7( b). The scan order illustrated in FIGS. 7(a) and 7(b) is referred to as a “forward scan”.

FIG. 7( c) is a diagram illustrating a scan order for a plurality of (inFIG. 7( b), 4×4=16) sub-blocks obtained by splitting a block. In a casewhere the sub-blocks are scanned as in FIG. 7( c), respective frequencydomains in the sub-blocks are scanned in a scan order illustrated inFIG. 7( d). The scan order illustrated in FIGS. 7( c) and 7(d) isreferred to as a “backward scan”.

A transverse axis of each of FIGS. 8( a) to 8(f) expresses a horizontalfrequency xC (where 0≦xC≦7), and a longitudinal axis thereof expresses avertical frequency yC (where 0≦yC≦7). In the following description,among partial domains included in a frequency domain, a partial domaindesignated by the horizontal frequency xC and the vertical frequency yCis also referred to as a frequency component (xC, yC). In addition, atransform coefficient for the frequency component (xC, yC) is alsodenoted by Coeff (xC, yC). A transform coefficient Coeff (0, 0)indicates a DC component, and other transform coefficients indicatecomponents other than the DC component. In the present specification,(xC, yC) may be denoted as (u, v). Further, in a case where the thoseskilled in the art or the transform/quantization bypass is applied, thehorizontal frequency xC is assumed to be interpreted as a horizontalpixel position xC, and the vertical frequency yC is assumed to beinterpreted as a vertical pixel position yC. A pixel designated by thehorizontal pixel position xC and the vertical pixel position yC isreferred to as a pixel (xC, yC). Furthermore, a prediction residual forthe pixel (xC, yC) is denoted by Coeff(xC, yC).

FIG. 8( a) is a diagram illustrating a scan order in a case where ablock having a TU size of 8×8 is split into sub-blocks each having asize of 4×4, and respective frequency components (or respective pixels)are scanned in the forward scan.

FIG. 8( b) is a diagram exemplifying non-zero coefficients in afrequency domain including 8×8 frequency components (or a pixel domainincluding 8×8 components). In a case of the example illustrated in FIG.8( b), last_significant_coeff_x is 6, and last_significant_coeff_y is 0.

FIG. 8( c) is a diagram illustrating each value of the sub-blockcoefficient presence/absence flag significant_coeff_group_flag which isdecoded for each sub-block in a case where decoding target transformcoefficients are ones illustrated in FIG. 8( b). A value ofsignificant_coeff_group_flag regarding a sub-block including at leastone non-zero coefficient is set to 1, and a value ofsignificant_coeff_group_flag regarding a sub-block including no non-zerocoefficient is set to 0.

FIG. 8( d) is a diagram illustrating each value of the syntaxsignificant_coeff_flag indicating the presence or absence of a non-zerocoefficient in a case where decoding target transform coefficients areones illustrated in FIG. 8( b). For a sub-block in whichsignificant_coeff_group_flag is 1, significant_coeff_flag is decoded inthe backward scan order, and for a sub-block in whichsignificant_coeff_group_flag is 0, significant_coeff_flag for all thefrequency components (or pixels) included in the sub-block is set to 0without decoding significant_coeff_flag (a lower left sub-block of FIG.8( d)).

FIG. 8( e) is a diagram illustrating each value obtained by decoding thesyntaxes coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag,and coeff_abs_level_remaining in a case where decoding target transformcoefficients are ones illustrated in FIG. 8( b).

FIG. 8( f) is a diagram illustrating the syntax coeff_sign_flag in acase where decoding target transform coefficients are ones illustratedin FIG. 8( b).

Decoding of the syntaxes coeff_abs_level_greater1_flag,coeff_abs_level_greater2_flag, and coeff_abs_level_remaining indicatinga value of each transform coefficient changes depending on a mode (highthroughput mode). The high throughput mode is turned off at the time ofstart of a sub-block, and the high throughput mode is turned on at thetime when the number of non-zero coefficients in a sub-block is equal toor larger than a predetermined constant. In the high throughput mode,decoding of some of the syntaxes are skipped.

The syntax coeff_abs_level_greater1_flag is a flag indicating whether ornot an absolute value of a transform coefficient exceeds 1, and is codedfor a frequency component in which a value of the syntaxsignificant_coeff_flag is 1. In a case where a value of a transformcoefficient exceeds 1, a value of coeff_abs_level_greater1_flag is 1,and, otherwise, a value of coeff_abs_level_greater1_flag is 0. Inaddition, decoding of coeff_abs_level_greater1_flag is skipped in thehigh throughput mode.

The syntax coeff_abs_level_greater2_flag is a flag indicating whether ornot an absolute value of a transform coefficient exceeds 2, and is codedwhen a value of coeff_abs_level_greater1_flag is 1. In a case where anabsolute value of a transform coefficient exceeds 2, a value ofcoeff_abs_level_greater2_flag is 1, and, otherwise, a value ofcoeff_abs_level_greater2_flag is 0. In addition, decoding ofcoeff_abs_level_greater2_flag is skipped after the first time in eachsub-block, and in a case of the high throughput mode.

In a case where an absolute value of a transform coefficient is apredetermined base level baseLevel, the syntax coeff_abs_level_remainingis a syntax for designating an absolute value of the transformcoefficient. In a case where decoding of coeff_abs_level_greater1_flagis skipped, coeff_abs_level_greater2_flag is skipped, and in a casewhere coeff_abs_level_greater1_flag is 1, coeff_abs_level_greater2_flagis coded when a value thereof is 1. A value of the syntaxcoeff_abs_level_remaining is obtained by subtracting baseLevel from anabsolute value of a transform coefficient. For example,coeff_abs_level_remaining=1 indicates that an absolute value of atransform coefficient is baseLevel+1. In addition, baseLevel isdetermined as follows.

baseLevel=1 (in a case where decoding of coeff_abs_level_greater1_flagis skipped)

baseLevel=2 (in a case where decoding of coeff_abs_level_greater2_flagis skipped in cases other than the above-described case)

baseLevel=3 (in a case where decoding of coeff_abs_level_greater2_flagis 1 in cases other than the above-described cases)

The syntax coeff_sign_flag is a flag indicating a sign (positive ornegative) of a transform coefficient, and is coded for a frequencycomponent in which a value of the syntax significant_coeff_flag is 1except for a case of performing sign hiding. The syntax coeff_sign_flagtakes 1 if a transform coefficient is positive, and takes 0 if atransform coefficient is negative.

In addition, the sign hiding refers to a method in which a sign of atransform coefficient is not explicitly coded but is calculated throughcomputation.

The variable length code decoding unit 11 included in the moving imagedecoding apparatus 1 can generate a transform coefficient Coeff (xC, yC)for each frequency component (or each pixel) by decoding the syntaxeslast_significant_coeff_x, last_significant_coeff_y,significant_coeff_flag, coeff_abs_level_greater1_flag,coeff_abs_level_greater2_flag, and coeff_sign_flag,coeff_abs_level_remaining.

In addition, a set of non-zero coefficients in a specific domain (forexample, a TU) is also referred to a significance map in some cases.

Details of decoding processes of the various syntaxes will be describedlater, and a configuration of the moving image decoding apparatus 1 willnow be described.

(Moving Image Decoding Apparatus 1)

Hereinafter, a description will be made of the moving image decodingapparatus 1 according to the present embodiment with reference to thedrawings. The moving image decoding apparatus 1 is a decoding apparatuswhich employs the technique proposed in High-Efficiency Video Coding(HEVC) which is a succeeding codec of the H. 264/MPEG-4 AVC standard.

FIG. 9 is a block diagram illustrating a configuration of the movingimage decoding apparatus 1. As illustrated in FIG. 9, the moving imagedecoding apparatus 1 includes the variable length code decoding unit 11,a predicted image generating unit 12, an inverse quantization/inversetransform unit 13, an adder 14, a frame memory 15, and a loop filter 16.In addition, as illustrated in FIG. 9, the predicted image generatingunit 12 includes a motion vector recovering unit 12 a, aninter-predicted image generating unit 12 b, an intra-predicted imagegenerating unit 12 c, and a prediction type determining unit 12 d. Themoving image decoding apparatus 1 is an apparatus which generates amoving image #2 by decoding the coded data #1.

(Variable Length Code Decoding Unit 11)

FIG. 10 is a block diagram illustrating a main part configuration of thevariable length code decoding unit 11. As illustrated in FIG. 10, thevariable length code decoding unit 11 includes a quantized residualinformation decoding unit 111, a prediction parameter decoding unit 112,a prediction type information decoding unit 113, and a filter parameterdecoding unit 114.

The variable length code decoding unit 11 decodes a prediction parameterPP regarding each partition from the coded data #1 in the predictionparameter decoding unit 112 and supplies the prediction parameter PP tothe predicted image generating unit 12. Specifically, the predictionparameter decoding unit 112 decodes inter-prediction parameters PP_Interincluding a reference image index, an estimation motion vector index,and a motion vector difference from the coded data #1 in relation to aninter-prediction partition, and supplies the inter-prediction parametersto the motion vector recovering unit 12 a. On the other hand, inrelation to an intra-prediction partition, intra-prediction parametersPP_Intra including an estimated prediction mode flag, an estimatedprediction mode index, and a remaining prediction mode index are decodedfrom the coded data #1, and are supplied to the intra-predicted imagegenerating unit 12 c.

In addition, the variable length code decoding unit 11 decodes theprediction type information Pred_type for each partition from the codeddata #1 in the prediction type information decoding unit 113, andsupplies the prediction type information to the prediction typedetermining unit 12 d. Further, the variable length code decoding unit11 decodes the quantized residual information QD regarding a block, andthe quantization parameter difference Δpq regarding TU including theblock, from the coded data #1 in the quantized residual informationdecoding unit 111, and supplies the decoded information to the inversequantization/inverse transform unit 13. Furthermore, the variable lengthcode decoding unit 11 decodes the filter parameter FP from the codeddata #1 in the filter parameter decoding unit 114 and supplies thefilter parameter to the loop filter 16. Moreover, a specificconfiguration of the quantized residual information decoding unit 111will be described later, and thus description thereof is omitted here.

(Predicted Image Generating Unit 12)

The predicted image generating unit 12 identifies whether each partitionis an inter-prediction partition on which inter-prediction is to beperformed or an intra-prediction partition on which intra-prediction isto be performed on the basis of the prediction type informationPred_type for each partition. In addition, in the former case, aninter-predicted image Pred_Inter is generated, and the generatedinter-predicted image Pred_Inter is supplied to the adder 14 as apredicted image Pred, and, in the latter case, an intra-predicted imagePred_Intra is generated, and the generated intra-predicted imagePred_Intra is supplied to the adder 14. Further, in a case where a skipmode is applied to a process target PU, the predicted image generatingunit 12 omits decoding of other parameters which belongs to the PU.

(Motion Vector Recovering Unit 12 a)

The motion vector recovering unit 12 a recovers a motion vector mvregarding each inter-prediction partition on the basis of a motionvector difference regarding the partition and a recovered motion vectormv′ regarding another partition. Specifically, (1) an estimation motionvector is derived from the recovered motion vector mv′ according to anestimation method designated by the estimation motion vector index, and(2) the motion vector mv is obtained by adding the derived estimationmotion vector to the motion vector difference. In addition, therecovered motion vector mv′ regarding another partition may be read fromthe frame memory 15. The motion vector recovering unit 12 a supplies therecovered motion vector mv to the inter-predicted image generating unit12 b along with a corresponding reference image index RI.

(Inter-Predicted Image Generating Unit 12 b)

The inter-predicted image generating unit 12 b generates a motioncompensation image mc regarding each inter-prediction partition throughinter-frame prediction. Specifically, the motion compensation image mcis generated from an adaptive filtered decoded image P_ALF′ designatedby the reference image index RI which is supplied from the motion vectorrecovering unit 12 a, by using the motion vector mv supplied from themotion vector recovering unit 12 a. Here, the adaptive filtered decodedimage P_ALF′ is an image obtained by the loop filter 16 performing afilter process on a decoded image in which decoding of all frames havealready been completed, and the inter-predicted image generating unit 12b may read a pixel value of each pixel forming the adaptive filtereddecoded image P_ALF′ from the frame memory 15. The motion compensationimage mc generated by the inter-predicted image generating unit 12 b issupplied to the prediction type determining unit 12 d as theinter-predicted image Pred_Inter.

(Intra-Predicted Image Generating Unit 12 c)

The intra-predicted image generating unit 12 c generates a predictedimage Pred_Intra regarding each intra-prediction partition.Specifically, first, a prediction mode is specified on the basis of theintra-prediction parameters PP_Intra supplied from the variable lengthcode decoding unit 11, and assigns the specified prediction mode to atarget partition, for example, in a raster scan order.

Here, the specification of a prediction mode based on theintra-prediction parameters PP_Intra may be performed as follows. (1)The estimated prediction mode flag is decoded, and, in a case where theestimated prediction mode flag indicates that a prediction mode for aprocess target partition is the same as prediction modes assigned toperipheral partitions of the target partition, the prediction mode whichis assigned to the peripheral partitions of the target partition isassigned to the target partition. (2) On the other hand, in a case wherethe estimated prediction mode flag indicates that a prediction mode fora process target partition is not the same as prediction modes assignedto peripheral partitions of the target partition, the remainingprediction mode index is decoded, and a prediction mode indicated by theremaining prediction mode index is assigned to the target partition.

The intra-predicted image generating unit 12 c generates the predictedimage Pred_Intra from a (locally) decoded image P through inter-frameprediction according to a prediction method indicated by the predictionmode assigned to the target partition. The intra-predicted imagePred_Intra generated by the intra-predicted image generating unit 12 cis supplied to the prediction type determining unit 12 d. In addition,the intra-predicted image generating unit 12 c may generate thepredicted image Pred_Intra from the adaptive filtered decoded imageP_ALF through intra-frame prediction.

With reference to FIG. 11, definition of the prediction mode will bedescribed. FIG. 11 illustrates a definition of the prediction mode. Asillustrated in FIG. 11, thirty-six types of prediction modes aredefined, and the prediction modes are specified by numbers of “0” to“35” (intra-prediction mode indexes). In addition, as illustrated inFIG. 12, the following name is assigned to each prediction mode. Inother words, “0” is “Intra_Planar (planar prediction mode)”, “1” is“Intra DC (intra-DC prediction mode)”, “2” to “34” are “Intra Angular(direction prediction)”, and “35” is “Intra From Luma”. “35” is specificto a chroma prediction mode, and is a mode for performing chromaprediction on the basis of prediction of luminance. In other words, thechroma prediction mode “35” is a prediction mode using a luminance pixelvalue and a chroma pixel value. The chroma prediction mode “35” is alsoreferred to as an LM mode. The number of prediction modes(intraPredModeNum) is “35” regardless of a size of a target block.

(Prediction Type Determining Unit 12 d)

The prediction type determining unit 12 d determines whether eachpartition is an inter-prediction partition on which inter-prediction isto be performed or an intra-prediction partition on whichintra-prediction is to be performed on the basis of the prediction typeinformation Pred_type for a PU to which each partition belongs. Inaddition, in the former case, the inter-predicted image Pred_Intergenerated in the inter-predicted image generating unit 12 b is suppliedto the adder 14 as a predicted image Pred, and, in the latter case, theintra-predicted image Pred_Intra is generated in the intra-predictedimage generating unit 12 c is supplied to the adder 14 as a predictedimage Pred.

(Inverse Quantization/Inverse Transform Unit 13)

In a normal case (the transform skip is not performed(transform_skip_flag==0), and the transform/quantization bypass is notperformed (transquant_bypass_flag==0)), the inverse quantization/inversetransform unit 13 (1) inversely quantizes the transform coefficientCoeff which has been decoded from the quantized residual information QDof the coded data #1, (2) performs inverse frequency transform such asinverse discrete cosine transform (DCT) on a transform coefficientCoeff_IQ obtained through the inverse quantization, and (3) supplies aprediction residual D obtained through the inverse frequency transformto the adder 14. In addition, in a case where the transform/quantizationbypass is performed (transquant_bypass_flag==1), the inversequantization/inverse transform unit 13 (1) supplies the transformcoefficient Coeff (equivalent to the prediction residual D) which hasbeen decoded from the quantized residual information QD of the codeddata #1 to the adder 14. Further, in a case where the transform skip isperformed (transform_skip_flag==1), the inverse quantization/inversetransform unit 13 (1) inversely quantizes the transform coefficientCoeff which has been decoded from the quantized residual information QDof the coded data #1, and (2) supplies the transform coefficientCoeff_IQ (equivalent to the prediction residual D) obtained through theinverse quantization to the adder 14. Furthermore, in a case where thetransform coefficient Coeff decoded from the quantized residualinformation QD is inversely quantized, the inverse quantization/inversetransform unit 13 derives a quantization step QP from the quantizationparameter difference Δqp supplied from the variable length code decodingunit 11. The quantization parameter qp may be derived by adding thequantization parameter difference Δqp to a quantization parameter qp′regarding a TU which is previously subject to inverse quantization andinverse frequency transform, and the quantization step QP may be derivedfrom the quantization parameter qp by, for example, QP=2^(qp/6). Inaddition, the generation of the prediction residual D by the inversequantization/inverse transform unit 13 is performed in the unit of TU orin the units of blocks into which the TU is split.

In addition, for example, if a size of a target block is 8×8 pixels, aposition of a pixel in the target block is set to (i, j) (where 0≦i≦7and 0≦j≦7), a value of the prediction residual D at the position (i, j)is indicated by D(i, j), and a transform coefficient which is inverselyquantized in a frequency component (u, v) (where 0≦u≦7 and 0≦v≦7) isindicated by Coeff_IQ(u, v), the inverse DCT performed by the inversequantization/inverse transform unit 13 is given by, for example, thefollowing Equation (1).

$\begin{matrix}{\mspace{79mu} \lbrack {{Math}.\mspace{14mu} 1} \rbrack} & \; \\{{D( {i,j} )} = {\frac{1}{4}{\sum\limits_{u = 0}^{7}\; {\sum\limits_{v = 0}^{7}{{C(u)}{C(v)}{Coeff\_ IQ}( {u,v} )\cos \{ \frac{( {{2i} + 1} )u\; \pi}{16} \} \cos \{ \frac{( {{2j} + 1} )v\; \pi}{16} \}}}}}} & (1)\end{matrix}$

Here, (u, v) are variables corresponding to the above-described (xC,yC). C(u) and C(v) are given as follows.

C(u)=1/√2 (u=0)

C(u)=1 (u≠0)

C(v)=1/√2 (v=0)

C(v)=1 (v≠0)

In addition, in a case where the transform skip is performed, inversefrequency transform is not performed, and thus the prediction residualD(i, j) at the position (i, j) of the pixel in the corresponding targetblock is equivalent to the inversely quantized transform coefficientCoeff_IQ(u, v) as in the following equation.

D(i,j)=Coeff_IQ(u,v) (where i=u and j=v)

In addition, in a case where the transform/quantization bypass isperformed, inverse quantization and inverse frequency transform are notperformed, and thus the prediction residual D(i, j) at the position (i,j) of the pixel in the corresponding target block is equivalent to thetransform coefficient Coeff (u, v) as in the following equation.

D(i,j)=Coeff(u,v) (where i=u and j=v)

(Adder 14)

The adder 14 generates a decoded image P by adding the predicted imagePred supplied from the predicted image generating unit 12 to theprediction residual D supplied from the inverse quantization/inversetransform unit 13. The generated decoded image P is stored in the framememory 15.

(Loop Filter 16)

The loop filter 16 functions (1) as a deblocking filter (DF) whichperforms smoothing (deblock process) on a peripheral image on a blockboundary or a partition boundary in the decoded image P, and (2) as anadaptive loop filter (ALF) of performing an adaptive filter process onthe image to which the deblocking filter has been applied, by using thefilter parameter FP.

(Quantized Residual Information Decoding Unit 111)

The quantized residual information decoding unit 111 has a configurationfor decoding the quantized transform coefficient Coeff (xC, yC) for eachcoefficient position (or each frequency component or each pixel) (xC,yC) from the quantized residual information QD included in the codeddata #1. Here, xC and yC are indexes indicating a position of eachfrequency component in a frequency domain or a pixel domain, and areindexes which respectively correspond to the horizontal frequency u andthe vertical frequency v in the frequency domain, or the horizontalpixel position u and the vertical pixel position v in the pixel domain.Hereinafter, the quantized transform coefficient Coeff may also besimply referred to as a transform coefficient Coeff.

FIG. 1 is a block diagram illustrating a configuration of the quantizedresidual information decoding unit 111. As illustrated in FIG. 1, thequantized residual information decoding unit 111 includes a transformcoefficient decoding unit 120 and an arithmetic code decoding unit 130.

(Arithmetic Code Decoding Unit 130)

The arithmetic code decoding unit 130 has a configuration for decodingeach bit included in the quantized residual information QD by referringto context, and includes a context recording/updating unit 131 and a bitdecoding unit 132 as illustrated in FIG. 1.

[Context Recording/Updating Unit 131]

The context recording/updating unit 131 has a configuration forrecording and updating a context variable CV which is managed by eachcontext index ctxIdx. Here, the context variable CV includes (1) asuperior symbol MPS (most probable symbol) of which an occurrenceprobability is high, and (2) a probability state index pStateIdx fordesignating an occurrence probability of the superior symbol MPS.

The context recording/updating unit 131 updates the context variable CVby referring to the context index ctxIdx supplied from each constituentelement included in the transform coefficient decoding unit 120 and avalue of a Bin decoded by the bit decoding unit 132, and records theupdated context variable CV until updated next. In addition, thesuperior symbol MPS is 0 or 1. Further, the superior symbol MPS and theprobability state index pStateIdx are updated whenever the bit decodingunit 132 decodes a single Bin.

In addition, the context index ctxIdx may directly designate a contextregarding each coefficient position (each frequency component or eachpixel), and may be an increment value from an offset of a context indexwhich is set for each process target TU (this is also the same for thefollowing).

[Bit Decoding Unit 132]

The bit decoding unit 132 decodes each bit (also referred to as a Bin)included in the quantized residual information QD by referring to thecontext variable CV which is recorded in the context recording/updatingunit 131. In addition, a value of the Bin obtained through the decodingis supplied to each constituent element included in the transformcoefficient decoding unit 120. Further, a value of the Bin obtainedthrough the decoding is also supplied to the context recording/updatingunit 131 so as to be referred to for updating the context variable CV.

(Transform Coefficient Decoding Unit 120)

As illustrated in FIG. 1, the transform coefficient decoding unit 120includes a last coefficient position decoding unit 121, a scan ordertable storage unit 122, a coefficient decoding control unit 123, acoefficient presence/absence flag decoding unit, a coefficient valuedecoding unit 125, a decoded coefficient storage unit 126, a sub-blockcoefficient presence/absence flag decoding unit 127, and a transformskip/transform/quantization bypass flag decoding unit 128.

[Last Coefficient Position Decoding Unit 121]

The last coefficient position decoding unit 121 interprets the decodedbit (Bin) supplied from the bit decoding unit 132 so as to decode thesyntaxes last_significant_coeff_x and last_significant_coeff_y. Thedecoded syntaxes last_significant_coeff_x and last_significant_coeff_yare supplied to the coefficient decoding control unit 123. In addition,the last coefficient position decoding unit 121 calculates the contextindex ctxIdx for determining context used to decode Bins of the syntaxeslast_significant_coeff_x and last_significant_coeff_y in the arithmeticcode decoding unit 130. The calculated context index ctxIdx is suppliedto the context recording/updating unit 131.

[Scan Order Table Storage Unit 122]

The scan order table storage unit 122 stores a table which provides aposition of a process target frequency component in a frequency domainor a pixel domain by using a size of a process target TU (block), a scanindex indicating the type of scan direction, and a frequency componentidentification index which is given according to a scan order, asarguments.

An example of such a scan order table may include ScanOrder asillustrated in FIGS. 4 and 5. ScanOrder illustrated in FIGS. 4 and 5 isa table for obtaining a position (xC, yC) of a process target transformblock in a frequency domain on the basis of a width size log 2TrafoWidthof a process target TU, a height size log 2TrafoHeight of the processtarget TU, a scan index scanIdx, and a frequency componentidentification index n which is given according to a scan order. Inaddition, in a case where the transform skip or thetransform/quantization bypass is applied, ScanOrder is a table forobtaining a position (xC, yC) of a process target transform block in apixel domain on the basis of a width size log 2TrafoWidth of a processtarget TU, a height size log 2TrafoHeight of the process target TU, ascan index scanIdx, and a frequency component identification index nwhich is given according to a scan order. Further, hereinafter, aposition (xC, yC) of a process target transform block in a frequencydomain or a pixel domain may be simply referred to as a coefficientposition (xC, yC).

Further, the table stored in the scan order table storage unit 122 isdesignated by a size of a process target TU (block) and the scan indexscanIdx associated with a prediction mode index of an intra-predictionmode. In a case where a prediction method used for a process target TUis intra-prediction, the coefficient decoding control unit 123 refers toa table which is designated by a size of the TU and the scan indexscanIdx associated with a prediction mode of the TU, so as to determinea scan order of transform blocks.

FIG. 13 illustrates an example of the scan index scanIdx which isdesignated by an intra-prediction mode index IntraPredMode and a valuelog 2TrafoSize for designating a TU size. In FIG. 13, log 2TrafoSize−2=0indicates that a TU size is 4×4 (corresponding to 4×4 pixels), and log2TrafoSize−2=1 indicates that a TU size is 8×8 (corresponding to 8×8pixels). As illustrated in FIG. 13, for example, in a case where the TUsize is 4×4, and the intra-prediction mode index is 1, the scan index of0 is used, and, in a case where the TU size is 4×4, and theintra-prediction mode index is 6, the scan index of 2 is used.

FIG. 14( a) illustrates a scan type ScanType designated by each value ofthe scan index scanIdx. As illustrated in FIG. 14( a), in a case wherethe scan index is 0, an up-right diagonal scan is designated; in a casewhere the scan index is 1, a horizontal fast scan is designated; and ina case where the scan index is 2, a vertical fast scan is designated.

In addition, FIG. 14( b) illustrates a scan order of each scan in thehorizontal fast scan, the vertical fast scan, and the up-right diagonalscan in a case where a TU size is 4×4. In FIG. 14( b), numbers given tothe respective coefficient positions indicate an order in which thecoefficient positions are scanned. Further, each example illustrated inFIG. 14( b) shows a forward scan direction. Furthermore, the scan ofFIG. 14( b) is not limited to the 4×4 TU size, and may be used in a 4×4sub-block. Moreover, the same scan may be used in a TU or a sub-blockhaving a larger size than 4×4.

FIG. 14( c) illustrates another example of the horizontal fast scan andthe vertical fast scan. In this example, the scans are used in a TU sizeor a sub-block of 8×2 or 2×8.

[Sub-Block Scan Order Table]

In addition, the scan order table storage unit 122 stores a sub-blockscan order table for designating a scan order of sub-blocks. Thesub-block scan order table is designated by a size of a process targetTU (block) and the scan index scanIdx associated with a prediction modeindex (prediction direction) of an intra-prediction mode. In a casewhere a prediction method used for a process target TU isintra-prediction, the coefficient decoding control unit 123 refers to atable which is designated by a size of the TU and the scan index scanIdxassociated with a prediction mode of the TU, so as to determine a scanorder of sub-blocks.

[Coefficient Decoding Control Unit 123]

The coefficient decoding control unit 123 has a configuration forcontrolling an order of a decoding process in each constituent elementincluded in the quantized residual information decoding unit 111.

The coefficient decoding control unit 123 includes a sub-block splittingunit 129 (not illustrated). The sub-block splitting unit 129 splits a TUinto sub-blocks. Details of the sub-block splitting unit 129 will bedescribed later.

The coefficient decoding control unit 123 specifies a position of thelast non-zero coefficient according to the forward scan by referring tothe syntaxes last_significant_coeff_x and last_significant_coeff_ysupplied from the last coefficient position decoding unit 121, andsupplies a position (xCG, yCG) of each sub-block to the sub-blockcoefficient presence/absence flag decoding unit 127 in a backward scanorder of a scan order which uses a position of a sub-block including thespecified position of the last non-zero coefficient as a starting pointand is given by the sub-block scan order table stored in the scan ordertable storage unit 122.

Further, in relation to a process target sub-block, the coefficientdecoding control unit 123 supplies a position (xC, yC) of each frequencycomponent included in the process target sub-block to the coefficientpresence/absence flag decoding unit 124 and the decoded coefficientstorage unit 126 in a backward scan order of a scan order which is givenby the scan order table stored in the scan order table storage unit 122.Here, as a scan order of each coefficient (each frequency component oreach pixel) included in the process target sub-block, in a case ofintra-prediction, a scan order (any one of the horizontal fast scan, thevertical fast scan, and the up-right diagonal scan) indicated by a scanindex scanIdx which is designated by the intra-prediction mode indexIntraPredMode and a value log 2TrafoSize for designating a TU size maybe used, and, in a case of inter-prediction, the up-right diagonal scanmay be used.

As mentioned above, the coefficient decoding control unit 123 has aconfiguration of setting a sub-block scan order according to aprediction direction of intra-prediction in a case where a predictionmethod which is applied to a process target unit domain (a block or aTU) is the intra-prediction.

Generally, since an intra-prediction mode and a bias of a transformcoefficient are correlated with each other, a scan order is changedaccording to the intra-prediction mode, and a scan suitable for biasesof the sub-block coefficient presence/absence flag and the coefficientpresence/absence flag can be performed. Consequently, it is possible toreduce a code amount of the sub-block coefficient presence/absence flagand the coefficient presence/absence flag which are coding and decodingtargets, and thus to reduce a processing amount and to improve codingefficiency.

[Sub-Block Splitting Unit 129]

The sub-block splitting unit 129 derives a sub-block size in accordancewith a scan order and a TU size, and splits a TU into sub-blocks bysplitting the TU in the derived sub-block size. Hereinafter, a method ofderiving a sub-block size will be sequentially described. In addition,as described above, in a case where a scan order is determined by the CUprediction type information PredMode, a TU size, and theintra-prediction mode index IntraPredMode, a sub-block size can also bederived by using the CU prediction type information PredMode, the TUsize, and the intra-prediction mode index IntraPredMode.

(Configuration of Deriving Sub-Block Size by Using CU Prediction TypeInformation PredMode, TU Size, and Intra-Prediction Mode IndexIntraPredMode)

FIG. 27 is a diagram illustrating a method of deriving a sub-block sizeby using the CU prediction type information PredMode, a TU size, and theintra-prediction mode index IntraPredMode. In a case where the CUprediction type information PredMode is intra-prediction, as illustratedin FIG. 13, on the basis of a TU size and the intra-prediction modeindexIntraPredMode, a sub-block size of 8×2 is used if the horizontalfast scan is used; a sub-block size of 2×8 is used if the vertical fastscan is used; and a sub-block of 4×4 is used if other scans (theup-right diagonal scan) are used.

In a case where the CU prediction type information PredMode isinter-prediction, a sub-block size of 4×4 is used if a width and aheight of a TU size are the same as each other. In a case where a widthand a height of a TU size are not the same as each other, and the widthof the TU size is larger than the height thereof, a sub-block size of8×2 is used. On the other hand, in a case where the height of the TUsize is larger than the width thereof, a sub-block size of 2×8 is used.In addition, in a case of the inter-prediction, a sub-block size may be4×4 regardless of a TU size.

Split into sub-blocks is performed according to the configuration. Thus,a CU is suitably split into sub-blocks in accordance with a bias of atransform coefficient can be performed both in a case ofintra-prediction and in a case of inter-prediction, and therefore codingefficiency is improved.

[Transform Skip/Transform/Quantization Bypass Flag Decoding Unit 128]

The transform skip/transform/quantization bypass flag decoding unit 128interprets a decoded bit (Bin) supplied from the bit decoding unit 132so as to decode the syntaxes transquant_bypass_flag andtransform_skip_flag. The decoded syntaxes transquant_bypass_flag andtransform_skip_flag are supplied to the coefficient presence/absenceflag decoding unit 124, the coefficient value decoding unit 125, and theinverse quantization/inverse transform unit 13. In addition, thetransform skip/transform/quantization bypass flag decoding unit 128calculates a context index ctxIdx which is used for the arithmetic codedecoding unit 130 to decode Bins of the syntaxes transquant_bypass_flagand transform_skip_flag. The calculated context index ctxIdx is suppliedto the context recording/updating unit 131.

Hereinafter, with reference to FIG. 19, a decoding process of thetransform/quantization bypass flag and the transform skip flag will bedescribed in detail.

<<Decoding Process 1 of Transform/Quantization Bypass Flag and TransformSkip Flag>>

FIG. 19( a) illustrates syntax examples of the transform/quantizationbypass flag and the transform skip flag, and FIG. 19( b) is a flowchartmore specifically illustrating the decoding process.

(Step S20-1)

First, the transform skip/transform/quantization bypass flag decodingunit 128 determines whether or not the transform/quantization bypassenabled flag (transquant_bypass_enabled_flag) which is input from anexternal device is 1. In a case where the transform/quantization bypassenabled flag is 1 (Yes in step S20-1), the flow proceeds to step S20-2.In other cases (No in step S20-1), the flow proceeds to step S20-3.

(Step S20-2)

The transform skip/transform/quantization bypass flag decoding unit 128decodes the transform/quantization bypass flag (transquant_bypass_flag)from coded data in relation to a target TU, and the flow proceeds tostep S20-4.

(Step S20-3)

The transform skip/transform/quantization bypass flag decoding unit 128implicitly interprets the transform/quantization bypass flag(transquant_bypass_flag) as 0 in relation to the target TU and sets avalue thereof to 0, and the flow proceeds to step S20-4.

(Step S20-4)

The transform skip/transform/quantization bypass flag decoding unit 128determines whether or not the transform skip enabled flag(transform_skip_enabled_flag) which is input from an external deviceis 1. In a case where the transform skip enabled flag is 1 (Yes in stepS20-4), the flow proceeds to step S20-5. In other cases (No in stepS20-4), the flow proceeds to step S20-7.

(Step S20-5)

The transform skip/transform/quantization bypass flag decoding unit 128determines whether or not the transform bypass flag is 0. In a casewhere the transform bypass flag is 0 (Yes in step S20-5), the flowproceeds to step S20-6. In other cases, the flow proceeds to step S20-7.

(Step S20-6)

The transform skip/transform/quantization bypass flag decoding unit 128decodes the transform skip flag (transform_skip_flag) from coded data inrelation to the target TU.

(Step S20-7)

The transform skip/transform/quantization bypass flag decoding unit 128implicitly interprets the transform/quantization bypass flag(transquant_bypass_flag) as 0 in relation to the TU and sets a valuethereof to 0.

In addition, a decoding process of the transform skip flag and thetransform/quantization bypass flag is not limited to the above-describedprocedures, and procedures may be changed in a scope in which theprocess can be performed. Further, the transformskip/transform/quantization bypass flag decoding unit 128 may decodeonly the transform skip flag from coded data in relation to a target TU(may omit decoding only the transform/quantization bypass flag).

For example, as illustrated in FIG. 20, after step S20-5, it may bedetermined that a TU size is smaller than a predetermined size (stepS20-8), and the flow may proceed to step S20-6 or step S20-7.

As mentioned above, according to the transformskip/transform/quantization bypass flag decoding unit 128, when comparedwith the related art (refer to FIG. 21), whether or not the transformskip is performed can be appropriately selected for each TU regardlessof a TU size or a prediction mode. For this reason, since a code amountof transform coefficients regarding a TU which is a coding and decodingtarget can be reduced, a processing amount is reduced, and codingefficiency is improved. In addition, since a branch process regardingwhether or not the transform skip flag is decoded can be reduced, aprocessing amount related to decoding of a transform coefficient can bereduced.

[Sub-Block Coefficient Presence/Absence Flag Decoding Unit 127]

The sub-block coefficient presence/absence flag decoding unit 127interprets each Bin supplied from the bit decoding unit 132, so as todecode a syntax significant_coeff_group_flag[xCG][yCG] designated byeach sub-block position (xCG, yCG). In addition, the sub-blockcoefficient presence/absence flag decoding unit 127 calculates a contextindex ctxIdx for determining context which is used for the arithmeticcode decoding unit 130 to decode a Bin of the syntaxsignificant_coeff_group_flag[xCG][yCG]. The calculated context indexctxIdx is supplied to the context recording/updating unit 131. Here, thesyntax significant_coeff_group_flag[xCG][yCG] takes 1 in a case where atleast one non-zero coefficient is included in a sub-block designated bythe sub-block position (xCG, yCG), and takes 0 in a case where nonon-zero coefficient is included therein. A value of the decoded syntaxsignificant_coeff_group_flag[xCG][yCG] is stored in the decodedcoefficient storage unit 126.

In addition, a more specific configuration of the sub-block coefficientpresence/absence flag decoding unit 127 will be described later.

[Coefficient Presence/Absence Flag Decoding Unit 124]

The coefficient presence/absence flag decoding unit 124 according to thepresent embodiment decodes a syntax significant_coeff_flag[xC][yC]designated by each coefficient position (xC, yC). A value of the decodedsyntax significant_coeff_flag[xC][yC] is stored in the decodedcoefficient storage unit 126. In addition, the coefficientpresence/absence flag decoding unit 124 calculates a context indexctxIdx for determining context which is for the arithmetic code decodingunit 130 to decode a Bin of the syntax significant_coeff_flag[xC][yC].The calculated context index ctxIdx is supplied to the contextrecording/updating unit 131. A specific configuration of the coefficientpresence/absence flag decoding unit 124 will be described later.

[Coefficient Value Decoding Unit 125]

The coefficient value decoding unit 125 interprets each Bin suppliedfrom the bit decoding unit 132 so as to decode the syntaxescoeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag,coeff_sign_flag, and coeff_abs_level_remaining, and derives a value ofeach coefficient position (a transform coefficient (more specifically, anon-zero coefficient) in a process target frequency component or a pixelposition), on the basis of results of decoding the syntaxes. Inaddition, the context index ctxIdx which has been used to decode thevarious syntaxes is supplied to the context recording/updating unit 131.The derived value of the transform coefficient is stored in the decodedcoefficient storage unit 126. A specific configuration of thecoefficient value decoding unit 125 will be described later.

[Decoded Coefficient Storage Unit 126]

The decoded coefficient storage unit 126 has a configuration for storingeach value of a transform coefficient decoded by the coefficient valuedecoding unit 125. In addition, the decoded coefficient storage unit 126stores each value of the syntax significant_coeff_flag decoded by thecoefficient presence/absence flag decoding unit 124. Each value of thetransform coefficient stored in the decoded coefficient storage unit 126is supplied to the inverse quantization/inverse transform unit 13.

(Configuration Example of Sub-Block Coefficient Presence/Absence FlagDecoding Unit 127)

Hereinafter, with reference to FIG. 15, a specific configuration exampleof the sub-block coefficient presence/absence flag decoding unit 127will be described.

FIG. 15 is a block diagram illustrating a configuration example of thesub-block coefficient presence/absence flag decoding unit 127. Asillustrated in FIG. 15, the sub-block coefficient presence/absence flagdecoding unit 127 includes a sub-block coefficient presence/absence flagcontext deriving unit 127 a, a sub-block coefficient presence/absenceflag storage unit 127 b, and a sub-block coefficient presence/absenceflag setting unit 127 c.

Hereinafter, the sub-block coefficient presence/absence flag decodingunit 127 will be described by exemplifying a case where a sub-blockposition (xCG, yCG) is supplied from the coefficient decoding controlunit 123 to the sub-block coefficient presence/absence flag decodingunit 127 in a backward scan order. In addition, in this case, thesub-block position (xCG, yCG) is supplied to a configuration of a codingapparatus side corresponding to the sub-block coefficientpresence/absence flag decoding unit 127 in a forward scan order.

(Sub-Block Coefficient Presence/Absence Flag Context Deriving Unit 127a)

The sub-block coefficient presence/absence flag context deriving unit127 a included in the sub-block coefficient presence/absence flagdecoding unit 127 derives a context index assigned to a sub-block whichis designated by each sub-block position (xCG, yCG). The context indexassigned to the sub-block is used to decode a Bin indicating the syntaxsignificant_coeff_group_flag for the sub-block. In addition, in a casewhere the context index is derived, a value of the decoded sub-blockcoefficient presence/absence flag stored in the sub-block coefficientpresence/absence flag storage unit 127 b is referred to. The sub-blockcoefficient presence/absence flag context deriving unit 127 a suppliesthe derived context index to the context recording/updating unit 131.

Specifically, the context index assigned to the sub-block is derived asfollows by using the sub-block position (xCG, yCG) and a value of thedecoded sub-block coefficient presence/absence flag stored in thesub-block coefficient presence/absence flag storage unit 127 b.

The context index is set as follows by referring to a value of thedecoded sub-block coefficient presence/absence flagsignificant_coeff_group_flag[xCG+1][yCG] which is decoded for thesub-block (xCG+1, yCG) located to be adjacent to the right side of thesub-block position (xCG, yCG) and a value of the decoded sub-blockcoefficient presence/absence flagsignificant_coeff_group_flag[xCG][yCG+1] which is decoded for thesub-block (xCG, yCG+1) located on the lower side of the sub-blockposition (xCG, yCG).

ctxIdx=ctxIdxOffset+Min((significant_coeff_group_flag[xCG+1][yCG]+significant_coeff_group_flag[xCG][yCG+1]),1)

In addition, the initial value ctxIdxOffset is determined by cIdxindicating a color space. Further, in a case where a decoded sub-blocklocated at (xCG+1, yCG) or (xCG, yCG+1) is not present, a value of asub-block coefficient presence/absence flag located at (xCG+1, yCG) or(xCG, yCG+1) is treated as zero.

(Sub-Block Coefficient Presence/Absence Flag Storage Unit 127 b)

The sub-block coefficient presence/absence flag storage unit 127 bstores each value of the syntax significant_coeff_group_flag which isdecoded or is set by the sub-block coefficient presence/absence flagsetting unit 127 c. The sub-block coefficient presence/absence flagsetting unit 127 c may read the syntax significant_coeff_group_flagassigned to an adjacent sub-block from the sub-block coefficientpresence/absence flag storage unit 127 b.

(Sub-Block Coefficient Presence/Absence Flag Setting Unit 127 c)

The sub-block coefficient presence/absence flag setting unit 127 cdecodes or sets the syntax significant_coeff_group_flag[xCG][yCG] byinterpreting each Bin supplied from the bit decoding unit 132. Morespecifically, the sub-block coefficient presence/absence flag settingunit 127 c decodes or sets the syntaxsignificant_coeff_group_flag[xCG][yCG] by referring to the sub-blockposition (xCG, yCG) and the syntax significant_coeff_group_flag assignedto a sub-block (also referred to as an adjacent sub-block) adjacent to asub-block designated by the sub-block position (xCG, yCG). In addition,a value of the decoded or set syntaxsignificant_coeff_group_flag[xCG][yCG] is supplied to the coefficientpresence/absence flag decoding unit 124.

As illustrated in FIG. 16( c), the sub-block coefficientpresence/absence flag setting unit 127 c refers to a value of thesub-block coefficient presence/absence flagsignificant_coeff_group_flag[xCG+1][yCG] assigned to the sub-block(xCG+1, yCG) adjacent to the sub-block position (xCG, yCG) and a valueof the sub-block coefficient presence/absence flagsignificant_coeff_group_flag[xCG][yCG+1] assigned to the sub-block (xCG,yCG+1), so as to derive a context index used to decode the sub-blockcoefficient presence/absence flagsignificant_coeff_group_flag[xCG][yCG+1].

In addition, in a block in which the sub-block coefficientpresence/absence flag is set to 0, decoding of the coefficientpresence/absence flag significant_coeff_flag is skipped, and thus adecoding process is simplified.

With reference to FIG. 17, a specific example thereof will be described.In a case where transform coefficients are distributed as illustrated inFIG. 17( a), a sub-block coefficient presence/absence flag assigned toeach sub-block is as illustrated in FIG. 17( b). In other words, among4×4 sub-blocks, a non-zero coefficient is present in the sub-blocks ofthe first row, but a non-zero coefficient is not present in thesub-blocks of the second row and thereafter.

Therefore, in the example illustrated in FIG. 17( b), the coefficientpresence/absence flag decoding unit 124 can skip decoding of thecoefficient presence/absence flag significant_coeff_flag in decoding ofthe sub-blocks of the second row and thereafter.

<<Configuration Example of Coefficient Presence/Absence Flag DecodingUnit 124>>

Hereinafter, a specific configuration of the coefficientpresence/absence flag decoding unit 124 will be described with referenceto FIG. 18.

FIG. 18 is a block diagram illustrating a configuration example of thecoefficient presence/absence flag decoding unit 124. As illustrated inFIG. 18, the coefficient presence/absence flag decoding unit 124includes a context deriving means selecting unit 124 a, a positioncontext deriving unit 124 b, an adjacent sub-block coefficientpresence/absence context deriving unit 124 c, a transformskip/transform/quantization bypass context deriving unit 124 d, and acoefficient presence/absence flag setting unit 124 e.

(Coefficient Presence/Absence Flag Setting Unit 124 e)

The coefficient presence/absence flag setting unit 124 e interprets eachBin supplied from the bit decoding unit 132 so as to set the syntaxsignificant_coeff_flag[xC][yC]. The set syntaxsignificant_coeff_flag[xC][yC] is supplied to the decoded coefficientstorage unit 126.

In a case where a target transform block (a target frequency domain or atarget pixel domain) is split into sub-blocks, the coefficientpresence/absence flag setting unit 124 e refers to the syntaxsignificant_coeff_group_flag[xCG][yCG] assigned to a target sub-block,and sets significant_coeff_flag[xC][yC] for all coefficient positionsincluded in the target sub-block to 0 in a case where a value ofsignificant_coeff_group_flag[xCG][yCG] is 0.

(Context Deriving Means Selecting Unit 124 a)

A frequency component or a pixel position (also referred to as acoefficient position) (xC, yC) which is a process target, andlogarithmic values (log 2TrafoWidth and log 2TrafoHeight) of a transformblock are input to the context deriving means selecting unit 124 a. Onthe basis of the logarithmic value sizes, a width and a height of thetransform block is calculated by using (1<<log 2TrafoWidth) and (1<<log2Trafo Height). In addition, instead of the logarithmic value sizes, awidth and a height of the transform block may be directly input.Further, the transform skip flag (transform_skip_flag) and thetransform/quantization bypass flag (transquant_bypass_flag) are input tothe context deriving means selecting unit 124 a.

The context deriving means selecting unit 124 a selects the positioncontext deriving unit 124 b, the adjacent sub-block coefficientpresence/absence context deriving unit 124 c, or the transformskip/transform/quantization bypass context deriving unit 124 d, inaccordance with a transform skip flag, a transform/quantization bypassflag, a target TU size, and a position of a decoding target coefficient.The selected context deriving unit derives a context index ctxIdx.

Hereinafter, a context deriving means selecting process performed by thecontext deriving means selecting unit 124 a will be described in detailwith reference to FIG. 30.

First, it is determined whether the transform skip is to be performed orthe transform/quantization bypass is to be performed (step SB801 in FIG.30). In a case where a transform_skip_flag indicates that the transformskip is to be performed (transform_skip_flag==1), or atransform/quantization bypass flag indicates that thetransform/quantization bypass is to be performed(transquant_bypass_flag==1) (Yes in step SB801), the context derivationselecting means selects the transform skip/transform/quantization bypasscontext deriving unit (step SB805). In addition, in a case where thetransform skip or the transform/quantization bypass is to be performed,an inverse transform process is skipped, and thus a position of acoefficient becomes a position of a pixel in a TU.

In a case where the above-described condition is not satisfied (No instep SB801), the context deriving means selecting unit 124 a selectseither the position context deriving unit 124 b or the adjacentsub-block coefficient presence/absence context deriving unit 124 c.

First, it is determined whether or not a target coefficient position isa DC (xC+yC==0) in a frequency domain, or a TU size is equal to orsmaller than a predetermined size (for example, a 4×4 TU or an 8×8 TU)(step SB802). In a case where the target coefficient position is the DCin the frequency domain, or the TU size is equal to or smaller than thepredetermined size (Yes in step SB802), the context deriving meansselecting unit 124 a selects the position context deriving unit 124 b.

In a case where the above-described condition is not satisfied (No instep SB802), the context deriving means selecting unit 124 a selects theadjacent sub-block coefficient presence/absence context deriving unit124 c (step SB803).

In addition, the context deriving means selecting unit 124 a is notlimited to the above-described configuration, and may have aconfiguration of deriving a context index ctxIdx which is common to TUsizes of a 4×4 TU to a 32×32 TU. In other words, the context derivingmeans selecting unit 124 a may have a configuration of fixedly selectingeither one of the position context deriving unit 124 b and the adjacentsub-block coefficient presence/absence context deriving unit 124 cregardless of a TU size.

(Position Context Deriving Unit 124 b)

The position context deriving unit 124 b derives a context index ctxIdxfor a target frequency component on the basis of a position (xC, yC) ofthe target frequency component in a frequency domain. In addition, in acase where a context index ctxIdx which is a fixed value is derivedregardless of a position of a frequency component, the position contextderiving unit 124 b may perform the derivation process.

FIG. 22 illustrates an example in which the position context derivingunit 124 b derives a context index regarding each coefficient positionin a case where a TU size is equal to or smaller than predetermined size(for example, a 4×4 TU or an 8×8 TU). FIG. 22( a) illustrates a case ofthe 4×4 TU, and FIG. 22( b) illustrates a case of the 8×8 TU.

(Adjacent Sub-Block Coefficient Presence/Absence Context Deriving Unit124 c)

The adjacent sub-block coefficient presence/absence context derivingunit 124 c selects a context derivation pattern according to whether ornot a non-zero coefficient is present in an adjacent sub-block, andderives a context index for a decoding target frequency component fromcoordinates of the process target frequency component in a sub-blockaccording to the selected derivation pattern.

First, the adjacent sub-block coefficient presence/absence contextderiving unit 124 c refers to the right adjacent sub-block illustratedin FIG. 16( b) and the lower adjacent sub-block illustrated in FIG. 16(a), and obtains a pattern index idxCG which is an index for specifying acontext derivation pattern, from the sub-block coefficientpresence/absence flag in each of the adjacent sub-blocks, by using thefollowing Equation (A).

idxCG=significant_coeff_group_flag[xCG+1][yCG]+(significant_coeff_group_flag[xCG][yCG+1]−1)  (A)

In the above Equation (A), significant_coeff_group_flag is a flagindicating that at least one non-zero coefficient is present in asub-block as described above. In a case where at least one non-zerocoefficient is present in a sub-block, a value ofsignificant_coeff_group_flag is “1”, and in a case where no non-zerocoefficient is present in a sub-block, a value ofsignificant_coeff_group_flag is “0”.

FIG. 41 illustrates a pseudo-code for deriving a context index ctxIdx(sigCtx) which is assigned to each frequency component of a targetsub-block on the basis of the pattern index idxCG. In addition, FIG. 42illustrates arrangements of context indexes in respective patternindexes idxCG, obtained by using the pseudo-code illustrated in FIG. 41.FIG. 42( a) illustrates a case of pattern index idxCG==0, FIG. 42( b)illustrates a case of pattern index idxCG==1, FIG. 42( c) illustrates acase of pattern index idxCG==2, and FIG. 42( d) illustrates a case ofpattern index idxCG==3. Further, a context index corresponding to eachpattern index idxCG is not limited to the pseudo-code illustrated inFIG. 41, and may be derived by using a pseudo-code illustrated in FIG.28. FIG. 29 illustrates arrangements of context indexes in respectivepattern indexes idxCG, obtained by using the pseudo-code illustrated inFIG. 28. FIG. 29( a) illustrates a case of pattern index idxCG==0, FIG.29( b) illustrates a case of pattern index idxCG==1, FIG. 29( c)illustrates a case of pattern index idxCG==2, and FIG. 29( d)illustrates a case of pattern index idxCG==3.

Transform Skip/Transform/Quantization Bypass Context Deriving Unit 124 dExample 1

The transform skip/transform/quantization bypass context deriving unit124 d derives a context index ctxIdx for a coefficient in a pixel domainof a target transform block on the basis of a predetermined methodduring the transform skip or the transform/quantization bypass. Forexample, a context index is derived on the basis of a relative contextindex corresponding to a width size of a TU and a height size of the TU.

A description will be made of a specific deriving process of a contextindex ctxIdx with reference to FIG. 31( a). FIG. 31( a) illustrates atable TBL_CTX_IDX[log 2TrafoWidth−2][log 2TrafoHeight−2] of alogarithmic value log 2TrafoWidth of a TU width size, a logarithmicvalue log 2TrafoHeight of a TU height size, and a corresponding relativecontext index. The context index ctxIdx is derived from the followingequation by referring to the table.

ctxIdx=TBL_CTX_IDX[log 2TrafoWidth−2][log 2TrafoHeight−2]+offset  (eq.A-1)

In the above Equation (eq. A-1), the variable offset is a predeterminedoffset value for differentiation from context indexes derived by theposition context deriving unit 124 b and the adjacent sub-blockcoefficient presence/absence context deriving unit 124 c, and indicatesa starting point of a context index in a case where the transform skipor the transform/quantization bypass is applied (this is also the samefor the following Equations (eq. A-2) to (eq. A-6)).

In a case where the transform skip or the transform/quantization bypassis performed, a decoding target coefficient presence/absence flag is anon-zero coefficient in a pixel domain. Since an appearance probabilityof a non-zero coefficient at each coefficient position in a pixel domainand an appearance probability of a non-zero coefficient in a frequencydomain are different from each other, it is preferable to differentiatecontexts regarding coefficient presence/absence flags from each other inthe pixel domain and the frequency domain.

As described above, according to the transformskip/transform/quantization bypass context deriving unit 124 d, a fixedcontext index is used in a TU or a sub-block in a case where thetransform skip is performed. Accordingly, during the transform skip, acontext index can be derived regardless of a position in the TU or inthe sub-block, and thus a process can be easily performed. In addition,during the transform skip, a context having a property in which anappearance probability of a coefficient in the TU or the sub-block isuniform is used, and thus it is possible to achieve an effect ofimproving coding efficiency.

Further, also in the same manner for a case where thetransform/quantization bypass is performed, the same (also referred toas “fixed”) context index can be derived regardless of a position in aTU or a position in a sub-block, and thus a process can be easilyperformed. Furthermore, during the transform/quantization bypass, acontext having a property in which an appearance probability of acoefficient in the TU or the sub-block is uniform is used, and thus itis possible to achieve an effect of improving coding efficiency.

In addition, in the above-described configuration, the same contextindex is used in a case where the transform skip is performed and a casewhere the transform/quantization bypass is performed. Consequently,contexts used in a case where the transform skip is performed andcontexts used in a case where the transform/quantization bypass isperformed are shared, and thus it is possible to achieve an effect ofminimizing the number of contexts. Generally, in a picture usinglossless coding, blocks which do not use lossless coding are also codedin low QP (small number of quantization steps) so that the entirepicture uniformly has high image quality. In this case, sincecoefficients of the transform/quantization bypass which is mainly usedfor lossless coding have the same appearance probability as that ofcoefficients of the transform skip, contexts can be shared between thetransform skip and the transform/quantization bypass.

In addition, in the configuration, also in a pixel domain, sinceappearance probabilities of a non-zero coefficient are differentdepending on a TU size, it is preferable to differentiate contextsregarding coefficient presence/absence flags from each other forrespective TU sizes. In other words, according to the transformskip/transform/quantization bypass context deriving unit 124 d, it ispossible to derive a context index which is suitable for a non-zerocoefficient in the pixel domain for each TU size. For this reason, sincea code amount of a non-zero coefficient can be further reduced in a TUwhich is a coding and decoding target, it is possible to achieve effectsof reducing a processing amount related to decoding of the non-zerocoefficient and also of improving coding efficiency.

Modification Example 1-A

In addition, the transform skip/transform/quantization bypass contextderiving unit 124 d may derive a context index ctxIdx on the basis of alogarithmic value log 2TrafoSize (=(log 2TrafoWidth+log2TrafoHeight)>>1) of a TU size instead of the logarithmic value log2TrafoWidth of a TU width size and the logarithmic value log2TrafoHeight of a TU height size, during the transform skip or thetransform/quantization bypass. For example, a context index is derivedfrom the following equation by referring to a table TBL_CTX_IDX[log2TrafoSize−2] of a logarithmic value log 2TrafoSize of a TU size and arelative context index, illustrated in FIG. 31( b).

ctxIdx=TBL_CTX_IDX[log 2TrafoSize−2]+offset  (eq. A-2)

Generally, an appearance probability of a non-square TU size is lowerthan that of a square TU size. For this reason, there is a slightreduction in the improvement achieved as a result of sharing contexts ofnon-zero coefficients in the pixel domain between a non-square TU sizeand a square TU size having the same number of elements.

As mentioned above, according to the transformskip/transform/quantization bypass context deriving unit 124 d, it ispossible to minimize the number of contexts regarding non-zerocoefficient presence/absence flag in a pixel domain, newly used for thetransform skip or the transform/quantization bypass, and also to achievean effect of improving coding efficiency.

Modification Example 1-B

The transform skip/transform/quantization bypass context deriving unit124 d may derive a context index ctxIdx for a coefficient in a pixeldomain of a target transform block on the basis of a prediction typePredType, a TU width size, a TU height size, and a correspondingrelative context index, during the transform skip or thetransform/quantization bypass. For example, a context index is derivedfrom the following equation by referring to a tableTBL_CTX_IDX[PredType][log 2TrafoWidth−2][log 2TrafoHeight−2] of aprediction type PredType, a logarithmic value log 2TrafoWidth of a TUwidth size, a logarithmic value log 2TrafoHeight of a TU height size,and a corresponding relative context index, illustrated in FIG. 32.

ctxIdx=TBL_CTX_IDX[PredType][log 2TrafoWidth−2][log2TrafoHeight−2]+offset  (eq. A-3)

Here, it is assumed that in a case of intra-prediction, a value of theprediction type PredType is 0, and, in a case of inter-prediction, avalue thereof is 1.

Generally, in a case where the transform skip or thetransform/quantization bypass is performed, since appearanceprobabilities of a non-zero coefficient in a decoding target pixeldomain are different from each other in the intra-prediction and theinter-prediction, it is preferable to differentiate contexts regardingcoefficient presence/absence flags from each other for respectiveprediction types.

As described above, according to the transformskip/transform/quantization bypass context deriving unit 124 d, it ispossible to derive a context index suitable for a non-zero coefficientin a pixel domain for each prediction type and each TU size. For thisreason, since a code amount of a non-zero coefficient can be reduced ina TU which is a coding and decoding target, it is possible to achieveeffects of reducing a processing amount related to decoding of thenon-zero coefficient and also of improving coding efficiency.

Modification Example 1-C

The transform skip/transform/quantization bypass context deriving unit124 d may derive a context index ctxIdx on the basis of a logarithmicvalue log 2TrafoSize (=(log 2TrafoWidth+log 2TrafoHeight)>>1) of a TUsize and a prediction type instead of the logarithmic value log2TrafoWidth of a TU width size and the logarithmic value log2TrafoHeight of a TU height size, during the transform skip or thetransform/quantization bypass. For example, a context index is derivedfrom the following equation by referring to a tableTBL_CTX_IDX[PredType][log 2TrafoSize−2] of the prediction type PredType,a logarithmic value log 2TrafoSize of a TU size, and a relative contextindex illustrated in FIG. 33.

ctxIdx=TBL_CTX_IDX[PredType][log 2TrafoSize−2]+offset  (eq. A-4)

Generally, an appearance probability of a non-square TU size is lowerthan that of a square TU size. For this reason, there is a slightreduction in the improvement achieved as a result of sharing contexts ofnon-zero coefficients in the pixel domain between a non-square TU sizeand a square TU size having the same number of elements.

As mentioned above, according to the transformskip/transform/quantization bypass context deriving unit 124 d, it ispossible to achieve effects of minimizing the number of contextsregarding non-zero coefficient presence/absence flag in a pixel domain,newly used for the transform skip or the transform/quantization bypassfor each prediction type, and also of improving coding efficiency.

Modification Example 1-D

As mentioned above, a description has been made of an example in whichthe transform skip/transform/quantization bypass context deriving unit124 d derives a separate context index in accordance with a TU size or aprediction type, but is not limited to. For example, the transformskip/transform/quantization bypass context deriving unit 124 d mayassign a fixed context index to a coefficient in a pixel domain of atarget transform block during the transform skip or thetransform/quantization bypass.

That is, ctxIdx=offset  (eq. A-5)

Consequently, it is possible to achieve effects of minimizing the numberof contexts regarding non-zero coefficient presence/absence flag in apixel domain, newly used for the transform skip or thetransform/quantization bypass, and also of improving coding efficiency.

Modification Example 1-E

In the transform skip/transform/quantization bypass context derivingunit 124 d, context indexes regarding non-zero coefficientpresence/absence flags are common to the transform skip and thetransform/quantization bypass, but separate context indexes may beassigned in the transform skip and the transform/quantization bypass.Generally, since appearance probabilities of a non-zero coefficient in adecoding target pixel domain are different from each other in thetransform skip and the transform/quantization bypass, it is preferableto differentiate contexts regarding coefficient presence/absence flagsfrom each other for respective prediction types. For example, a contextindex is derived from the following equation by referring to a tableTBL_CTX_IDX[PredType][log 2TrafoSize−2] of an identifier index foridentifying the transform skip and the transform/quantization bypassfrom each other, a logarithmic value log 2TrafoSize of a TU size, and arelative context index, illustrated in FIG. 34.

ctxIdx=TBL_CTX_IDX[index][log 2TrafoSize−2]+offset  (eq. A-6)

In addition, it is assumed that a value of the identifier index in theabove equation is 0 in the transform skip, and is 1 in thetransform/quantization bypass.

In use circumstances in which a variation in image quality in a pictureis allowed, quantization having a relatively large quantization step maybe performed on blocks which lossless coding is not applied. In thiscase, since an appearance probability of a coefficient in thetransform/quantization bypass which is mainly used for lossless codingis different from an appearance probability in the transform skip (anappearance probability thereof is low in a case of the transform skip inwhich quantization is performed), it is preferable to differentiatecontexts regarding coefficient presence/absence flags from each other.

As mentioned above, according to the transformskip/transform/quantization bypass context deriving unit 124 d, it ispossible to derive a context index which is suitable for a non-zerocoefficient in a pixel domain for each of the transform skip and thetransform/quantization bypass. For this reason, since a code amount of anon-zero coefficient can be reduced in a TU which is a coding anddecoding target, it is possible to achieve effects of reducing aprocessing amount related to decoding of the non-zero coefficient andalso of improving coding efficiency.

As mentioned above, a description has been made of a case where contextsregarding non-zero coefficient presence/absence flags are differentiatedfrom each other with respect to a coefficient in a frequency domain anda coefficient in a pixel domain in a case where the transform skip is tobe performed or the transform/quantization bypass is to be performed,but, also in relation to the GR1 flag (coeff_abs_level_greater1_flag)and GR2 flag (coeff_abs_level_greater2_flag), a context regarding theGR1 flag and a context regarding the GR2 flag may be differentiated fromeach other with respect to a coefficient in a frequency domain and apixel in a pixel domain in a case where the transform skip or thetransform/quantization bypass is to be performed.

<<Another Configuration Example of Coefficient Presence/Absence FlagDecoding Unit 124>>

Hereinafter, with reference to FIG. 59, another configuration example ofthe coefficient presence/absence flag decoding unit 124 will bedescribed.

FIG. 59 is a block diagram illustrating another configuration example ofthe coefficient presence/absence flag decoding unit 124. As illustratedin FIG. 59, the coefficient presence/absence flag decoding unit 124includes a context deriving means selecting unit 124Aa, a positioncontext deriving unit 124 b, an adjacent sub-block coefficientpresence/absence context deriving unit 124 c, a transform skip contextderiving unit 124Ad, and a coefficient presence/absence flag settingunit 124 e. In addition, the position context deriving unit 124 b, theadjacent sub-block coefficient presence/absence context deriving unit124 c, and the coefficient presence/absence flag setting unit 124 e havethe same functions as the corresponding constituent elements of FIG. 18and are thus given the same reference numerals, and description thereofwill be omitted.

(Context Deriving Means Selecting Unit 124Aa)

At least a process target coefficient position (xC, yC), logarithmicvalues (log 2TrafoWidth and log 2TrafoHeight) of a transform block size,and a transform skip flag (transform_skip_flag) are input to the contextderiving means selecting unit 124Aa.

The context deriving means selecting unit 124Aa selects the positioncontext deriving unit 124 b, the adjacent sub-block coefficientpresence/absence context deriving unit 124 c, or the transformskip/transform/quantization bypass context deriving unit 124 d, inaccordance with the transform skip flag, the target transform blocksize, and the target coefficient position. The selected context derivingunit derives a context index ctxIdx which is referred to when acoefficient presence/absence flag at the target coefficient position isdecoded.

Hereinafter, a context deriving means selecting process performed by thecontext deriving means selecting unit 124Aa will be described in detailwith reference to FIG. 60.

First, it is determined whether or not a transform size is 4×4 in stepSB801A. In a case where the transform size is 4×4 (Yes in step SB801A),the flow proceeds to step SB802A, and, otherwise (No in step SB801A),the flow proceeds to step SB803A.

In step SB802A, it is determined whether or not the transform skip isapplied to a target block. In a case where the transform skip is applied(the transform skip flag is 1) (Yes in step SB802A), the flow proceedsto step SB806A. In a case where the transform skip is not applied (No instep SB802A), the flow proceeds to step SB803A.

In step SB803A, in a case where the target coefficient position is aposition of a DC component in a frequency domain or the target transformblock size is equal to or smaller than a predetermined size (8×8 orsmaller), the flow proceeds to step SB805A. In other cases, the flowproceeds to step S804A.

In step SB804A, the context derivation selecting means selects theadjacent sub-block coefficient presence/absence context deriving means,so as to derive a context index, and finishes the process.

In step SB805A, the context derivation selecting means selects theposition context deriving means so as to derive a context index, andfinishes the process.

In step SB806A, the context derivation selecting means selects thetransform skip context deriving means so as to derive a context index,and finishes the process.

(Transform Skip Context Deriving Unit 124Ad)

The transform skip context deriving unit 124Ad derives a context(context index ctxIdx) which is referred to when a coefficientpresence/absence flag in a target coefficient is decoded during thetransform skip. The context derived here is a single context regardlessof a position of the target coefficient in a sub-block. Here, a separatecontext may be set as the single context. Specifically, the context maybe a context which is different from contexts which are derived by theother context deriving parts (the position context deriving unit 124 band the adjacent sub-block coefficient presence/absence context derivingunit 124 c).

In a case where the transform skip is performed, a decoding targetcoefficient presence/absence flag indicates a non-zero coefficient in apixel domain. On the other hand, in a case where the transform skip isnot applied, the coefficient presence/absence flag indicates a non-zerocoefficient in a frequency domain. Since an appearance probability of anon-zero coefficient in the pixel domain and an appearance probabilityof a non-zero coefficient in the frequency domain are different fromeach other, it is preferable to differentiate contexts regardingcoefficient presence/absence flags from each other in the pixel domainand the frequency domain. In addition, an appearance probability of anon-zero coefficient in the pixel domain has lower relevance with acoefficient position in a transform block or a sub-block than that of anappearance probability of a non-zero coefficient in a frequency domainare different from each other. For this reason, a context whichcorresponds to the appearance probability of a non-zero coefficient inthe pixel domain and is referred to for decoding a coefficientpresence/absence flag when the transform skip is applied, may bedetermined without depending on a coefficient position in a transformblock or a sub-block. In this case, it is possible to further reduce thenumber of contexts than in a case of selecting from among a plurality ofcontexts depending on a coefficient position.

In addition, in the above description, in the transform skip contextderiving unit 124Ad, an example in which a separate context is set as asingle context which is referred to for decoding a coefficientpresence/absence flag, but a context may be derived which is referred tofor decoding a coefficient presence/absence flag in a case where thetransform skip is not applied. In other words, a context in a case ofapplying the transform skip and a context in a case of not applying thetransform skip may be shared. In this case, there is an advantage inthat a total number of contexts does not increase.

Here, a description will be made of a specific example of sharingcontexts in cases of the transform skip is applied and is not applied. Acontext which is derived in a case where the transform skip is appliedis preferably derived for a coefficient presence/absence flag at aposition of a high frequency component by the position context derivingunit 124 b. More specifically, a context which is derived for acoefficient presence/absence flag of a high frequency domain indicatedby ‘8’ in FIG. 22( a) may be derived as a context for a coefficientpresence/absence flag in a case where the transform skip is applied. Thedependency of a coefficient presence/absence flag at a position of ahigh frequency component in the frequency domain on a coefficientposition is lower than the dependency of a coefficient presence/absenceflag at a position of a low frequency component on a coefficientposition. In a case where the transform skip is applied, since acoefficient presence/absence flag in a spatial domain has the relativelylow dependency on a coefficient position, if a context is to be shared,a context in a high frequency component is preferably shared.

As mentioned above, according to the transformskip/transform/quantization bypass context deriving unit 124 d, it ispossible to derive a context which is suitable for a non-zerocoefficient in a pixel domain in a case where the transform skip isapplied. For this reason, since a code amount of a non-zero coefficientcan be reduced in a TU which is a coding and decoding target, it ispossible to achieve effects of reducing a processing amount related todecoding of the non-zero coefficient and also of improving codingefficiency.

(Configuration Example of Coefficient Value Decoding Unit 125)

FIG. 43 is a block diagram illustrating a configuration example of thecoefficient value decoding unit 125. As illustrated in FIG. 43, thecoefficient value decoding unit 125 includes a coefficient leveldecoding unit 125 a, a coefficient sign decoding unit 125 b, acoefficient value recovering unit 125 c, and a coefficient numberderiving unit 125 d. The coefficient sign decoding unit 125 b includes acoefficient position deriving unit 125 e, a sign hiding flag derivingunit 125 f, a coefficient sum calculating unit 125 g, and a sign codederiving unit 125 h.

The coefficient level decoding unit 125 a decodes the syntaxescoeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, andcoeff_abs_level_remaining, and decodes an absolute value absLevel of atransform coefficient. In a case where the number numCoeff of non-zerocoefficients in a sub-block, supplied from the coefficient numberderiving unit 125 d, is equal to or larger than a predeterminedthreshold value TH, transition to a high throughput mode is performed.

The coefficient value recovering unit 125 c decodes a value of thetransform coefficient from the absolute value absLevel of the transformcoefficient supplied from the coefficient level decoding unit 125 a anda sign coeff_sign_flag of the transform coefficient supplied from thecoefficient sign decoding unit 125 b by using the following equation.

Coeff=absLevel*(1−2*coeff_sign_flag)

A value of coeff_sign_flag is 0 in a case where a sign is positive, andis 1 in a case where a sign is negative.

The coefficient number deriving unit 125 d derives the number numCoeffof non-zero transform coefficients in a sub-block, and supplies thenumber thereof to the coefficient level decoding unit 125 a. Inaddition, the number thereof is also supplied to the coefficient signdecoding unit 125 b in a case where the number numCoeff of non-zerotransform coefficients in a sub-block is used for the coefficient signdecoding unit 125 b to derive the sign hiding flag signHidden.

The coefficient sign decoding unit 125 b decodes or derives a signcoeff_sign of the transform coefficient from coded data.

The coefficient position deriving unit 125 e obtains a positionlastNZPosInCG of the last non-zero coefficient in a scan order and aposition firstNZPosInCG of the initial non-zero coefficient in the scanorder, and supplies the obtained results to the sign hiding flagderiving unit 125 f. The sign hiding flag deriving unit 125 f derives aflag signHidden indicating whether or not sign hiding is to be performedin a target sub-block, and supplies the flag to the sign code derivingunit 125 h. The coefficient sum calculating unit 125 g calculates acoefficient absolute value sum sumAbs of the target sub-block, andsupplies the coefficient absolute value sum to the sign code derivingunit 125 h.

The sign code deriving unit 125 h calculates the sign coeff_sign of thetransform coefficient at the position firstNZPosInCG from thecoefficient absolute value sum sumAbs of the target sub-block by usingthe following equation, in a case where the sign hiding is performed.

coeff_sign=(sumAbs%2)==1?−1:1

In a case where the sign hiding is not performed, a sign of thetransform coefficient is decoded by decoding the syntax coeff_sign_flagfrom coded data.

FIG. 44 is a flowchart illustrating an operation of the coefficient signdecoding unit 125 b according to the embodiment.

(Step SD001)

The sign hiding flag deriving unit 125 f derives the sign hiding flagsignHidden. The sign hiding flag signHidden indicates whether or notsign hiding is to be performed in a corresponding sub-block. Thederivation of signHidden is performed once in a sub-block. Details of aderivation method thereof will be described later.

(Step SD002)

A loop in a target sub-block is started. The loop is a loop having acoefficient position as the unit.

(Step SD003)

It is determined whether or not a non-zero coefficient is present at aposition of a target transform coefficient.

(Step SD004)

In a case where the non-zero coefficient is present (Yes in step SD003),it is determined whether or not a sign hiding enable flagsign_data_hiding_flag is 1. The sign hiding enable flagsign_data_hiding_flag is a flag indicating whether or not sign hiding isallowed to be performed in a sequence, a picture, or all slices, and iscoded in a parameter set such as an SPS or a PPS, or a slice header.

(Step SD005)

In a case where the sign hiding enable flag sign_data_hiding_flag is 1(Yes in step SD004), it is determined whether or not the sign hidingflag signHidden is 1.

(Step SD006)

In a case where the sign hiding flag signHidden is 1 (Yes in stepSD005), it is determined whether or not a target transform coefficientof the sign hiding flag signHidden is the initial non-zero coefficient(firstNZPosInCG?) (the last non-zero coefficient in a backward scanorder) in the sub-block in a scan order.

(Step SD007)

In a case where the target transform coefficient is the initial non-zerocoefficient in the sub-block in the scan order (Yes in step SD006), thesign code deriving unit 125 h derives a sign through computation.

(Step SD008)

In a case where, among the determinations of whether or not the signhiding is to be performed, any one determination result is negative(No), the sign code deriving unit 125 h decodes a sign from coded data.

(Step SD009)

The loop in the sub-block is finished.

FIG. 45 is a flowchart illustrating the deriving process (step SD001) ofthe sign hiding flag signHidden performed by the sign hiding flagderiving unit 125 f.

(Step SD1201)

It is determined whether or not the transform/quantization bypass is tobe performed. In a case where the transform/quantization bypass is notperformed (transquant_bypass_flag==0) (Yes in step SD1201), the flowproceeds to step SD1202. In other cases (No in step SD1201), the flowproceeds to step SD1205.

(Step SD1202)

It is determined whether or not the transform skip is performed. In acase where the transform skip is not performed (transform_skip_flag==0)(Yes in step SD1202), the flow proceeds to step SD1203. In other cases,the flow proceeds to step SD1205.

(Step SD1203)

It is determined whether or not a difference between a positionlastNZPosInCG of a non-zero coefficient which appears last in a scanorder (initially appears in a backward scan order) in the sub-block anda position firstNZPosInCG of a non-zero coefficient which initiallyappears in the scan order (appears last in a backward scan order) isequal to or greater than a predetermined threshold valuesign_hiding_threshold. In a case where the difference in the scanprocess is equal to or greater than the predetermined threshold value(Yes in step SD1201), the flow proceeds to step S1204. In other cases(No in step SD1203), the flow proceeds to step S1205.

(Step SD1204)

The sign hiding flag signHidden is set to 1 which indicates that signhiding is to be performed.

(Step SD1205)

The sign hiding flag signHidden is set to 0 which indicates that signhiding is not to be performed.

Here, in step SD1203, whether or not sign hiding is to be performed isdetermined by using the threshold value sign_hiding_threshold, and thethreshold value preferably uses 4 as a specific example.

The processes in steps SD1202 to SD1205 are represented by the followingequation.

signHidden=(lastNZPosInCG−firstNZPosInCG>=sign_hiding_threshold) &&!transquant_bypass_flag && !transform_skip_flag ?1:0

In a case where the transform skip is performed, or thetransform/quantization bypass is to be performed, performing sign hidingwhich is accompanied by correction of a coefficient level value on acoefficient of a pixel domain may possibly cause deterioration insubjective image quality, and thus the sign hiding is preferablyprohibited. As mentioned above, in this configuration, by prohibitingsign hiding in the transform skip or the transform/quantization bypass,it is possible to achieve an effect of improving subjective imagequality.

In addition, the sign hiding flag deriving unit 125 f derives the signhiding flag signHidden on the basis of whether or not the transform skipis to be performed, whether or not the transform/quantization bypass isto be performed, and whether or not a difference between a position of anon-zero coefficient which initially appears in a scan order and aposition of a non-zero coefficient which appears last in the scan orderis the predetermined threshold value sign_hiding_threshold, but is notlimited thereto. For example, the sign hiding flag signHidden may bederived on the basis of whether or not a position of a non-zerocoefficient which appears last in a scan order is the predeterminedthreshold value sign_hiding_threshold.

In other words, signHidden=(lastNZPosInCG>=sign_hiding_threshold) &&!transquant_bypass_flag && !transform_skip_flag ? 1:0

(Another Configuration Example of Coefficient Value Decoding Unit 125)

FIG. 46 is a block diagram illustrating another configuration example ofthe coefficient value decoding unit 125. As illustrated in FIG. 46, thecoefficient value decoding unit 125 includes a coefficient leveldecoding unit 125 a, a coefficient sign decoding unit 125 b′, acoefficient value recovering unit 125 c, and a coefficient numberderiving unit 125 d. The coefficient sign decoding unit 125 b′ includesa coefficient position deriving unit 125 e, a sign hiding flag derivingunit 125 f′, a coefficient sum calculating unit 125 g, and a sign codederiving unit 125 h. Unlike the configuration illustrated in FIG. 43,the coefficient position deriving unit 125 e is omitted.

In a case of the configuration, the sign hiding flag deriving unit 125f′ derives the sign hiding flag signHidden on the basis of whether ornot the transform skip is to be performed, whether or not thetransform/quantization bypass is to be performed, and whether or not thenumber numCoeff of non-zero coefficients in a sub-block is equal to orlarger than the predetermined threshold value sign_hiding_threshold.

In other words, signHidden=(numSigCoeff>=sign_hiding_threshold) &&!transquant_bypass_flag && !transform_skip_flag ? 1:0

In this determination, since the number numCoeff of non-zerocoefficients in a sub-block is a variable which is also counted in leveldecoding, a particular process for sign hiding is not necessary, andthus it is possible to achieve an effect of simplifying processes.

(Sign Computation Process in Sign Hiding)

FIG. 47 is a flowchart illustrating a specific operation of the signcomputation process (step SD007) in the sign hiding performed by thesign code deriving unit 125 h.

(Step SD901)

The sign code deriving unit 125 h determines whether or not thecoefficient absolute value sum sumAbs in a target sub-block is an oddnumber.

(Step SD902)

In a case where the coefficient absolute value sum sumAbs in a targetsub-block is an odd number (Yes in step SD901), a sign of a targettransform coefficient is derived as being negative. The absolute valueabsLevel which has already been decoded is inversed.

(Step SD903)

In a case where the coefficient absolute value sum sumAbs in the targetsub-block is an even number (No in step SD901), a sign of a targettransform coefficient is derived as being positive. The absolute valueabsLevel which has already been decoded is used without being inversed.

(Configuration of not Using Coefficient Absolute Value Sum sumAbs inSign Hiding)

FIG. 48 is a flowchart illustrating an operation of the coefficient signdecoding unit 125 b in a case where the coefficient absolute value sumsumAbs is not used. Operations in step SD1001 to step SD1005, and stepSD1007 and step SD1008 are the same as the operations in step SD001 tostep SD005, and step SD007 and step SD008 of FIG. 44, and thusdescription thereof will be omitted.

(Step SD1006)

In a case where the sign hiding flag signHidden is 1 (Yes in stepSD1005), it is determined whether or not a target transform coefficientof the sign hiding flag signHidden is the last (highest frequency side)non-zero coefficient (lastNZPosInCG?) in the sub-block in a scan order.

(Step SD1007)

In a case where the target transform coefficient is the last non-zerocoefficient in the sub-block in the scan order (Yes in step SD1006), thesign code deriving unit 125 h derives a sign from an absolute value ofthe last non-zero coefficient in the scan order through computation.

FIG. 49 is a flowchart illustrating a specific operation of the signcomputation process (step SD1007) in the sign hiding performed by thesign code deriving unit 125 h in the configuration of not using thecoefficient absolute value sum sumAbs.

(Step SD1101)

The sign code deriving unit 125 h determines whether or not thecoefficient absolute value absLevel of a transform coefficient which isa sign hiding target is an odd number.

(Step SD1102)

In a case where the coefficient absolute value absLevel of the targetcoefficient an odd number (Yes in step SD1101), a sign of the targettransform coefficient is derived as being negative. The absolute valueabsLevel which has already been decoded is inversed.

(Step SD1103)

In a case where the coefficient absolute value absLevel of the targetcoefficient an odd number (No in step SD1101), a sign of the targettransform coefficient is derived as being positive. The absolute valueabsLevel which has already been decoded is used without being inversed.

Example 3

Hereinafter, a description will be made of decoding processes of the GR1flag, the GR2 flag, and a remaining coefficient level performed by thecoefficient level decoding unit 125 a.

(Decoding Process of GR1 Flag)

Hereinafter, a description will be made of a decoding process of the GR1flag performed by the coefficient level decoding unit 125 a. FIG. 35 isa flowchart illustrating the decoding process of the GR1 flag.

It is assumed that coeff_abs_level_greatr1_flag[n] which stores a valueof the GR1 flag is initialized in advance.

(Step SD101)

The coefficient level decoding unit 125 a initializes various parametersrelated to the decoding of the GR1 flag.

A coefficient position identification index n is set to 15 (n=15).

A coefficient number numSigCoeff is set to 0 (numSigCoeff=0).

A coefficient position firstGreater1CoeffIdx at which a value of the GR1flag initially appearing in a sub-block is 1 is set to −1(firstGreatr1CoeffIdx=−1).

In a case where a position (subset) of a decoding target sub-blockcorresponds to a sub-block including the last coefficient, a variablegreatr1Ctx indicating the number of decoded GR1 flags having a value of0 is initialized to 1 (that is, greater1Ctx=1).

In addition, in a case where a position (subset) of the decoding targetsub-block corresponds to a sub-block which does not include the lastcoefficient, the variable greatr1Ctx indicating the number of decodedGR1 flags having a value of 0 is updated by using the followingequation.

greater1Ctx=greater1Ctx>>1

(Step SD102)

A loop in a target sub-block is started. The loop is a loop having acoefficient position as the unit.

(Step SD103)

It is determined whether or not a coefficient position (xC, yC)specified by the coefficient position identification index n is anon-zero coefficient. In a case of the non-zero coefficient(significant_coeff_flag[xC][yC]==1) (Yes in step SD103), the flowproceeds to step SD104. In other cases(significant_coeff_flag[xC][yC]==0) (No in step SD103), the flowproceeds to step SD109.

(Step SD104)

It is determined whether or not the number numSigCoeff of the GR1 flagswhich are decoded in the sub-block is equal to or smaller than apredetermined threshold value. In a case where the number numSigCoeff ofthe GR1 flags which are decoded in the sub-block is equal to or smallerthan the predetermined threshold value (Yes in step SD104), the flowproceeds to step SD104. In other cases (No in step S104), the flowproceeds to step SD109.

(Step SD105)

The GR1 flag of the coefficient position identification index n isdecoded. In addition, a context index which is referred to for decodingthe GR1 flag is calculated as follows.

(Case where Neither Transform Skip Nor Transform/Quantization Bypass isPerformed)

In a case where neither the transform skip nor thetransform/quantization bypass is performed, a context index regardingthe GR1 flag at each coefficient position in a frequency domain isderived by using the following equation.

ctxIdx=4*ctxset+min(3,greater1ctx)  (eq. B-1)

Here, in Equation (eq. B-1), the variable ctxset is a value defined bythe number numGreater1 of coefficients whose transform coefficient levelabslevel in a sub-block which has been decoded before the targetsub-block in a decoding target transform block is equal to or higherthan 2 (a value of the GR1 flag is 1), a position (subset) of thedecoding target sub-block, and a color space cIdx.

First, the variable ctxset is initialized in advance by using thefollowing equation before starting decoding of the GR1 flag in thedecoding target sub-block.

ctxset=(subset>0 && cIdx==0)?2:0  (eq. B-2)

In other words, in a case where the color space cIdx indicates luminance(Y) (cIdx==0), and the position subset of the decoding target sub-blockcorresponds to a sub-block which does not include a DC coefficient(subset>0), the variable ctxset is set to 2. In other cases(subset==0∥cIdx>0), that is, in a case where the position subset of thetarget sub-block corresponds to a sub-block including a DC coefficient(subset==0), or the color space cIdx indicates chroma (U,V), thevariable ctxset is set to 0.

In addition, after the variable ctxset is initialized according to theabove Equation (eq. B-2), a value of the variable ctxset is updated onthe basis of the variable numGrater1 and the transform skip flagtransform_skip or the transform/quantization bypass flagtransquant_bypass_flag, before starting decoding of the GR1 flag in thedecoding target sub-block.

if(!transform_skip_flag &&!transquant_bypass_flag){ctxset=(numGreater1>0)?ctxset+1:ctxset}  (eq.B-3)

In addition, in Equation (eq. B-3), the variable greater1Ctx is a valuedefined by the GR1 flag (lastGrater1Ctx) decoded in SD105, the transformskip flag, and the transform/quantization bypass flag.

if(!transform_skip_flag &&!transquant_bypass_flag){greater1Ctx=(lastGreater1Ctx==1)?0:greatr1Ctx+1}  (eq.B-4)

Here, in (eq. B-4), the variable lastGreater1Ctx indicates a value ofthe GR1 flag which is previously decoded. In addition, in the aboveEquations (eq. B-3) and (eq. B-4), in a case where the transform skip orthe transform/quantization bypass is performed, values of the variablesctxset and greater1Ctx are not updated. This is because, in a case wherethe transform skip or the transform/quantization bypass is performed,the GR1 flag is a transform coefficient in a pixel domain, and, if avariable used to derive a context for the GR1 flag regarding a transformcoefficient in a frequency domain is updated, a state of the context forthe GR1 flag regarding a transform coefficient in a frequency domain isnot appropriately updated, and coding efficiency may be reduced.

(Case where Transform Skip or Transform/Quantization Bypass isPerformed)

In a case where the transform skip or the transform/quantization bypassis performed, a context index regarding the GR1 flag at each coefficientposition in a pixel domain is derived on the basis of a predeterminedmethod. A specific derivation method will be described later.

(Step SD106)

The number of decoded GR1 flags is counted (that is,numSigCoeff=numSigCoeff+1).

In addition, in a case where a coefficient level value of the decodedcoefficient position (xC, yC) is equal to or higher than 2 (a value ofthe GR1 flag is 1), the variable numGreater1 is updated on the basis ofthe transform skip flag and the transform/quantization bypass flag.

In other words, if(!transform_skip_flag &&!transquant_bypass_flag){numGreater1=coeff_abs_level_greater1_flag[n]==1?numGreater1+1:numGreater1}  (eq. B-5)

Here, in Equation (eq. B-5), in a case where the transform skip or thetransform/quantization bypass is performed, the variable numGreater1 isnot updated. This is because, in a case where the transform skip or thetransform/quantization bypass is performed, the GR1 flag and the GR2flag are transform coefficients in a pixel domain, and, if variablesused to derive contexts for the GR1 flag and the GR2 flag regardingtransform coefficients in a frequency domain are updated, states of thecontexts for the GR1 flag and the GR2 flag regarding transformcoefficients in a frequency domain are not appropriately updated, andcoding efficiency may be reduced.

(Step SD107)

It is determined whether or not a coefficient position is a coefficientposition where a value of the GR1 flag initially appearing in thesub-block is 1. In a case where whether or not the coefficient positionis a coefficient position where a value of the GR1 flag initiallyappearing in the sub-block is 1 (Yes in step SD107), the flow proceedsto step SD108. In other cases, the flow proceeds to step SD109.

(Step SD108)

The coefficient position (coefficient position identification index)where a value of the GR1 flag initially appearing in the sub-block is 1is set to the variable firstGreater1CoeffIdx (that is,firstGreater1CoeffIdx=n).

(Step SD109)

The coefficient position identification index n is updated (that is,n=n−1).

(Step SD110)

The loop in the sub-block is finished.

(Decoding Process of GR2 Flag)

Hereinafter, a description will be made of a decoding process of the GR2flag performed by the coefficient level decoding unit 125 a. FIG. 36 isa flowchart illustrating the decoding process of the GR2 flag.

It is assumed that coeff_abs_level_greatr2_flag[n] which stores a valueof the GR2 flag is initialized in advance.

(Step SE101)

It is determined whether or not there is a coefficient in which a valueof the GR1 flag initially appearing in the sub-block, obtained in thedecoding process of the GR1 flag, is 1. In other words, it is determinedwhether or not the variable firstGreater1CoeffIdx is −1. Here, in a casewhere the variable firstGreater1CoeffIdx is not −1 (Yes in step SE101),the flow proceeds to step S102. In other cases (No in step SE101), theGR2 flag is not decoded, and the decoding process of the GR2 flag isfinished.

(Step SE102)

The GR2 flag (coeff_abs_level_greater2_flag[firstGreatr1CoeffIdx]) at acoefficient position indicated by the variable firstGreatr1CoeffIdx isdecoded.

In addition, a context index which is referred to for decoding the GR2flag is calculated as follows.

(Case where Neither Transform Skip Nor Transform/Quantization Bypass isPerformed)

In a case where neither the transform skip nor thetransform/quantization bypass is performed, a context index regardingthe GR2 flag at each coefficient position in a frequency domain isderived by using the following equation.

ctxIdx=(cIdx==0)?ctxset:ctxset+4  (eq. C-1)

Here, in Equation (eq. C-1), the variable ctxset is a value defined bythe number numGreater1 of coefficients whose transform coefficient levelabslevel in a sub-block which has been decoded before the targetsub-block in a decoding target transform block is equal to or higherthan 2, a position (subset) of the decoding target sub-block, and acolor space cIdx. In addition, a derivation method of ctxset has alreadybeen described, and thus description thereof will be omitted.

(Case where Transform Skip or Transform/Quantization Bypass isPerformed)

In a case where the transform skip or the transform/quantization bypassis performed, a context index regarding the GR2 flag at each coefficientposition in a pixel domain is derived on the basis of a predeterminedmethod. A specific derivation method will be described later.

(Decoding Process of Remaining Coefficient Level)

Hereinafter, a description will be made of a decoding process of aremaining coefficient level performed by the coefficient level decodingunit 125 a. FIG. 37 is a flowchart illustrating the decoding process ofthe remaining coefficient level.

(Step SF101)

The coefficient level decoding unit 125 a initializes various parametersrelated to the decoding of the remaining coefficient level.

A coefficient position identification index n is set to 15 (n=15).

A coefficient number numSigCoeff is set to 0 (numSigCoeff=0).

(Step SF102)

A loop in a target sub-block is started. The loop is a loop having acoefficient position as the unit.

(Step SF103)

It is determined whether or not a coefficient position (xC, yC)specified by the coefficient position identification index n is anon-zero coefficient. In a case of the non-zero coefficient(significant_coeff_flag[xC][yC]==1) (Yes in step SF103), the flowproceeds to step SF104. In other cases(significant_coeff_flag[xC][yC]==0) (No in step SF103), the flowproceeds to step SF109.

(Step SF104)

A base level baseLevel of a transform coefficient at the coefficientposition (xC, yC) is calculated by using the following equation.

baseLevel=1+coeff_abs_level_greater1_flag[n]+coeff_abs_level_greater2_flag[n]  (eq.E-1)

(Step SF105)

It is determined whether or not the base level baseLevel of thetransform coefficient at the coefficient position (xC, yC) satisfies apredetermined value. The predetermined value is represented by thefollowing equation.

baseLevel==(numSigCoeff<TH)?((n==firstGreater1CoeffIdx) ?3:2):1  (eq.E-2)

In other words, 1) in a case where the coefficient number numSigCoeff isequal to or larger than a predetermined threshold value TH(numSigCoeff>=TH), it is determined whether or not baseLevel is 1.

2) In a case where the coefficient number numSigCoeff is smaller thanthe predetermined threshold value TH (numSigCoeff<TH), and thecoefficient position identification index n is notfirstGreater1CoeffIdx, it is determined whether or not baseLevel is 2.

3) In a case where the coefficient number numSigCoeff is smaller thanthe predetermined threshold value TH (numSigCoeff<TH), and thecoefficient position identification index n is firstGreater1CoeffIdx, itis determined whether or not baseLevel is 3.

As mentioned above, in a case where baseLevel is the same as the valuetaken in the above-described condition (Yes in step SF105), the flowproceeds to step SF106. In other cases (No in step SF105), the decodingof the remaining coefficient level coeff_abs_level_remaining is skipped(treated as coeff_abs_level_remaining[n]=0), and the flow proceeds tostep SF107.

(Step SF106)

The remaining coefficient level coeff_abs_level_remaining[n] of thetransform coefficient at the coefficient position (xC, yC) is decoded.

(Step SF107)

A coefficient level value absLevel of the transform coefficient at thecoefficient position (xC, yC) is calculated by using the followingequation.

absLevel=coeff_abs_level_remaining[n]+baseLevel  (eq. E-3)

(Step SF108)

The decoded coefficient number numSigCoeff is updated (that is,numSigCoeff=numSigCoeff+1).

(Step SF109)

The coefficient position identification index n is updated (that is,n=n−1).

(Step SF110)

The loop in the sub-block is finished.

(as to Context Index Derivation of GR1 Flag/GR2 Flag During TransformSkip or Transform/Quantization Bypass)

In a case where the transform skip or the transform/quantization bypassis applied, the coefficient level decoding unit 125 a derives contextindexes ctxIdx regarding the GR1 flag and the GR2 flag, for example, onthe basis of a relative context index corresponding to a TU width sizeand a TU height size.

A specific deriving process of the context index ctxIdx will bedescribed with reference to FIG. 31( a). FIG. 31( a) illustrates a tableTBL_CTX_IDX[log 2TrafoWidth−2][log 2TrafoHeight−2] of a logarithmicvalue log 2TrafoWidth of a TU width size, a logarithmic value log2TrafoHeight of a TU height size, and a corresponding relative contextindex. The context index ctxIdx is derived from the following equationby referring to the table.

ctxIdx=TBL_CTX_IDX[log 2TrafoWidth−2][log 2TrafoHeight−2]+offset  (eq.C-1)

In the above Equation (eq. C-1), in a case of the GR1 flag, the variableoffset is a predetermined offset value for differentiating a contextindex for the GR1 flag in a frequency domain from a context index forthe GR1 flag in a case where the transform skip or thetransform/quantization bypass is applied. Similarly, in a case of theGR2 flag, the variable offset is a predetermined offset value fordifferentiating a context index for the GR2 flag in a frequency domainfrom a context index for the GR2 flag in a case where the transform skipor the transform/quantization bypass is applied, and indicates astarting point of a context index regarding the GR1 flag or the GR2 flagin a case where the transform skip or the transform/quantization bypassis applied. This is also the same for the variable offset in thefollowing Equations (eq. C-2) to (eq. C-6).

In a case where the transform skip or the transform/quantization bypassis to be performed, the GR1 flag and the GR2 flag which are decodingtargets are transform coefficients in a pixel domain. Since anappearance probability of the GR1 flag and the GR2 flag at eachcoefficient position in a pixel domain and an appearance probability ofthe GR1 flag and the GR2 flag in a frequency domain are different fromeach other, it is preferable to differentiate contexts regarding the GR1flag and the GR2 flag from each other in the pixel domain and thefrequency domain.

As mentioned above, according to the coefficient level decoding unit 125a, in a case where the transform skip or the transform/quantizationbypass is performed, it is possible to derive context indexes suitablefor the GR1 flag and the GR2 flag in a pixel domain. For this reason,since a code amount of the GR1 flag and the GR2 flag can be reduced in aTU which is a coding and decoding target, it is possible to achieveeffects of reducing a processing amount related to decoding of the GR1flag and the GR2 flag and also of improving coding efficiency.

In addition, also in a pixel domain, since appearance probabilities of anon-zero coefficient are different depending on a TU size, it ispreferable to differentiate contexts regarding the GR1 flag and the GR2flag from each other for respective TU sizes. In other words, accordingto the coefficient level decoding unit 125 a, it is possible to derivecontext indexes suitable for the GR1 flag and the GR2 flag in the pixeldomain for each TU size. For this reason, since a code amount of a theGR1 flag and the GR2 flag can be further reduced in a TU which is acoding and decoding target, it is possible to achieve effects of furtherreducing a processing amount related to decoding of the GR1 flag and theGR2 flag and also of improving coding efficiency.

In addition, in the above description, a description has been made of acase where the transform skip or the transform/quantization bypass isperformed, that is, an example in which a context for the GR1 flag isdifferentiated from a context in a frequency domain with respect to atransform coefficient in a pixel domain, but the present invention isnot limited thereto. For example, in a case where the transform skip isperformed, a context different from a context in a frequency domain maybe used, and, in a case where the transform/quantization bypass isperformed, a context in the frequency domain may be shared and used.

In a case where the transform/quantization bypass is applied, atransform coefficient is not quantized, and thus a code amount of thetransform coefficient increases. For this reason, a code amount of theGR1 flag which is a flag indicating whether or not a value of aquantized transform coefficient is greater than 1 is low in a ratio ofoccupying a code amount of a transform coefficient. For this reason,even if a code amount of the GR1 flag is reduced by using a contextdifferent from a context in a frequency domain, there is a probabilitythat an overall code amount of coded data may no be greatly reduced. Onthe other hand, in a case where the transform skip is applied, since atransform coefficient is quantized, and thus a code amount of thetransform coefficient is smaller than in a case where thetransform/quantization bypass is applied. Therefore, if a code amount ofthe GR1 flag is reduced by using a context different from a context in afrequency domain, it is possible to relatively considerably reduce anoverall code amount of coded data. Consequently, in a case where thetransform skip is applied, the GR1 flag is coded with a contextdifferent from a context in a frequency domain, and, in a case where thetransform/quantization bypass is applied, the GR1 flag is coded with acontext which is shared with the frequency domain. Thus, it is possibleto achieve an effect of reducing a code amount without greatlyincreasing the number of contexts.

The above discussion is also applicable to the GR2 flag. In a case wherethe transform skip is applied, the GR2 flag is coded with a contextdifferent from a context in a frequency domain, and, in a case where thetransform/quantization bypass is applied, the GR2 flag is coded with acontext which is shared with the frequency domain. Thus, it is possibleto achieve an effect of reducing a code amount without greatlyincreasing the number of contexts.

Modification Example 3-A

In addition, the coefficient level decoding unit 125 a may derive acontext index ctxIdx on the basis of a logarithmic value log 2TrafoSize(=(log 2TrafoWidth+log 2TrafoHeight)>>1) of a TU size instead of thelogarithmic value log 2TrafoWidth of a TU width size and the logarithmicvalue log 2TrafoHeight of a TU height size, during the transform skip orthe transform/quantization bypass. For example, a context index isderived from the following equation by referring to the tableTBL_CTX_IDX[log 2TrafoSize−2] of a logarithmic value log 2TrafoSize of aTU size and a relative context index, illustrated in FIG. 31( b).

ctxIdx=TBL_CTX_IDX[log 2TrafoSize−2]+offset  (eq. C-2)

In the above Equation (eq. C-2), in a case of the GR1 flag, the variableoffset is a predetermined offset value for differentiating a contextindex for the GR1 flag in a frequency domain from a context index forthe GR1 flag in a case where the transform skip or thetransform/quantization bypass is applied. Similarly, in a case of theGR2 flag, the variable offset is a predetermined offset value fordifferentiating a context index for the GR2 flag in a frequency domainfrom a context index for the GR2 flag in a case where the transform skipor the transform/quantization bypass is applied.

Generally, an appearance probability of a non-square TU size is lowerthan that of a square TU size. For this reason, there is a slightreduction in the improvement achieved as a result of sharing contextsfor the GR1 flag and the GR2 flag in the pixel domain between anon-square TU size and a square TU size having the same number ofelements. Therefore, it is possible to minimize the number of contextsregarding the GR1 flag and the GR2 flag in a pixel domain, newly usedfor the transform skip or the transform/quantization bypass, and also toachieve an effect of improving coding efficiency.

Modification Example 3-B

The coefficient level decoding unit 125 a may derive context indexesctxIdx for the GR1 flag and the GR2 flag in a pixel domain of a targettransform block on the basis of a prediction type PredType, a TU widthsize, a TU height size, and a corresponding relative context index,during the transform skip or the transform/quantization bypass. Forexample, context indexes for the GR1 flag and the GR2 flag is derivedfrom the following equation by referring to the tableTBL_CTX_IDX[PredType][log 2TrafoWidth−2][log 2TrafoHeight−2] of aprediction type PredType, a logarithmic value log 2TrafoWidth of a TUwidth size, a logarithmic value log 2TrafoHeight of a TU height size,and a corresponding relative context index, illustrated in FIG. 32.

ctxIdx=TBL_CTX_IDX[PredType][log 2TrafoWidth−2][log2TrafoHeight−2]+offset  (eq. C-3)

In the above Equation (eq. C-3), in a case of the GR1 flag, the variableoffset is a predetermined offset value for differentiating a contextindex for the GR1 flag in a frequency domain from a context index forthe GR1 flag in a case where the transform skip or thetransform/quantization bypass is applied. Similarly, in a case of theGR2 flag, the variable offset is a predetermined offset value fordifferentiating a context index for the GR2 flag in a frequency domainfrom a context index for the GR2 flag in a case where the transform skipor the transform/quantization bypass is applied.

Here, it is assumed that in a case of intra-prediction, a value of theprediction type PredType is 0, and, in a case of inter-prediction, avalue thereof is 1.

Generally, in a case where the transform skip or thetransform/quantization bypass is performed, since appearanceprobabilities of the GR1 flag and the GR2 flag in a pixel domain whichis a decoding target are different from each other in theintra-prediction and the inter-prediction, it is preferable todifferentiate contexts regarding the GR1 flag and the GR2 flag from eachother for respective prediction types. In other words, according to thecoefficient level decoding unit 125 a, it is possible to derive acontext index suitable for the GR1 flag or the GR2 flag in a pixeldomain for each prediction type and each TU size. For this reason, sincea code amount of the GR1 flag and the GR2 flag can be reduced in a TUwhich is a coding and decoding target, it is possible to achieve effectsof reducing a processing amount related to decoding of the GR1 flag andthe GR2 flag and also of improving coding efficiency.

Modification Example 3-C

In addition, the coefficient level decoding unit 125 a may derive acontext index ctxIdx on the basis of a logarithmic value log 2TrafoSize(=(log 2TrafoWidth+log 2TrafoHeight)>>1) of a TU size and a predictiontype instead of the logarithmic value log 2TrafoWidth of a TU width sizeand the logarithmic value log 2TrafoHeight of a TU height size, duringthe transform skip or the transform/quantization bypass. For example, acontext index is derived from the following equation by referring to thetable TBL_CTX_IDX[PredType][log 2TrafoSize−2] of the prediction typePredType, a logarithmic value log 2TrafoSize of a TU size, and arelative context index illustrated in FIG. 33.

ctxIdx=TBL_CTX_IDX[PredType][log 2TrafoSize−2]+offset  (eq. C-4)

In the above Equation (eq. C-4), in a case of the GR1 flag, the variableoffset is a predetermined offset value for differentiating a contextindex for the GR1 flag in a frequency domain from a context index forthe GR1 flag in a case where the transform skip or thetransform/quantization bypass is applied. Similarly, in a case of theGR2 flag, the variable offset is a predetermined offset value fordifferentiating a context index for the GR2 flag in a frequency domainfrom a context index for the GR2 flag in a case where the transform skipor the transform/quantization bypass is applied.

Generally, an appearance probability of a non-square TU size is lowerthan that of a square TU size. For this reason, there is a slightreduction in the improvement achieved as a result of sharing contexts ofthe GR1 flag and the GR2 flag in the pixel domain between a non-squareTU size and a square TU size having the same number of elements. Asmentioned above, it is possible for the coefficient level decoding unit125 a to minimize the number of contexts regarding the GR1 flag and theGR2 flag in a pixel domain, newly used for the transform skip or thetransform/quantization bypass, and also to achieve an effect ofimproving coding efficiency.

Modification Example 3-D

As mentioned above, a description has been made of an example in whichthe coefficient level decoding unit 125 a derives a separate contextindex for the GR1 flag and the GR2 flag in accordance with a TU size ora prediction type, but is not limited to. For example, the coefficientlevel decoding unit 125 a may assign a fixed context index to the GR1flag and the GR2 flag in a pixel domain of a target transform blockduring the transform skip or the transform/quantization bypass.

That is, ctxIdx=offset  (eq. C-5)

In the above Equation (eq. C-5), in a case of the GR1 flag, the variableoffset is a predetermined offset value for differentiating a contextindex for the GR1 flag in a frequency domain from a context index forthe GR1 flag in a case where the transform skip or thetransform/quantization bypass is applied. Similarly, in a case of theGR2 flag, the variable offset is a predetermined offset value fordifferentiating a context index for the GR2 flag in a frequency domainfrom a context index for the GR2 flag in a case where the transform skipor the transform/quantization bypass is applied.

Therefore, it is possible to achieve effects of minimizing the number ofnewly used contexts regarding the GR1 flag and the GR2 flag in a pixeldomain and also of improving coding efficiency.

Modification Example 3-E

In the coefficient level decoding unit 125 a, context indexes regardingthe GR1 flag and the GR2 flag are common to the transform skip and thetransform/quantization bypass, but separate context indexes may beassigned in the transform skip and the transform/quantization bypass.Generally, since appearance probabilities of the GR1 flag and the GR2flag in a pixel domain which is a decoding target are different fromeach other in the transform skip and the transform/quantization bypass,it is preferable to differentiate contexts regarding the GR1 flag andthe GR2 flag from each other in the transform skip and thetransform/quantization bypass. For example, a context index is derivedfrom the following equation by referring to the tableTBL_CTX_IDX[PredType][log 2TrafoSize−2] of an identifier index foridentifying the transform skip and the transform/quantization bypassfrom each other, a logarithmic value log 2TrafoSize of a TU size, and arelative context index, as illustrated in FIG. 34.

ctxIdx=TBL_CTX_IDX[index][log 2TrafoSize−2]+offset  (eq. C-6)

In addition, it is assumed that a value of the identifier index in theabove equation is 0 in the transform skip, and is 1 in thetransform/quantization bypass.

In the above Equation (eq. C-6), in a case of the GR1 flag, the variableoffset is a predetermined offset value for differentiating a contextindex for the GR1 flag in a frequency domain from a context index forthe GR1 flag in a case where the transform skip or thetransform/quantization bypass is applied. Similarly, the variable offsetis a predetermined offset value for differentiating a context index forthe GR2 flag in a frequency domain from a context index for the GR2 flagin a case where the transform skip or the transform/quantization bypassis applied.

As mentioned above, according to the coefficient level decoding unit 125a, it is possible to derive context indexes suitable for the GR1 flagand the GR2 flag in a pixel domain for each of the transform skip andthe transform/quantization bypass. For this reason, since a code amountof the GR1 flag and the GR2 flag can be reduced in a TU which is acoding and decoding target, it is possible to achieve effects ofreducing a processing amount related to decoding of the GR1 flag and theGR2 flag and also of improving coding efficiency.

Modification Example 3-F

In addition, the coefficient level decoding unit 125 a derives a contextindex separately from the GR1 flag and the GR2 flag in a frequencydomain, in relation to both the GR1 flag and the GR2 flag, during thetransform skip or the transform/quantization bypass, but is not limitedthereto.

The coefficient level decoding unit 125 a may derive a contextseparately from the GR1 flag in a frequency domain according to any oneof the methods of Modification Example 3-A to Modification Example 3-Ein relation to at least the GR1 flag during the transform skip or thetransform/quantization bypass, and may also use a context for the GR2flag in the frequency domain during the transform skip or thetransform/quantization bypass in relation to the GR2 flag. In otherwords, in the same method (the above Equations (eq. C-1) and (eq. B-2))as in the GR2 flag in the frequency domain, a context index ctxIdx isderived.

This is because, in the coefficient level decoding unit 125 a, aplurality of GR1 flags may occur in a symbol, but at most one GR2 flagappears in the sub-block (that is, an appearance frequency of the GR2flag is low). For this reason, there is a slight reduction in theimprovement achieved as a result of using a context for the GR2 flag inthe frequency domain as a context for a context for the GR2 flag duringthe transform skip or the transform/quantization bypass. For thisreason, since a code amount of the GR1 flag and the GR2 flag can bereduced while an increase in the number of contexts for the GR2 flag isminimized, it is possible to achieve effects of reducing a processingamount related to decoding of the GR1 flag and the GR2 flag and also ofimproving coding efficiency.

Modification Example 3-G

In a case where the transform skip or the transform/quantization bypassis not performed, context indexes regarding the GR1 flag and the GR2flag in a frequency domain are derived in accordance with the numbernumGreater1 of coefficients whose transform coefficient level abslevelin a sub-block which has been decoded before the target sub-block in adecoding target transform block is equal to or higher than 2 (a value ofthe GR1 flag is 1), and the number of the variable greatr1Ctx indicatingthe number of decoded GR1 flags having a value of 0. For this reason,each context index for the GR1 flag and the GR2 flag cannot bedetermined unless a GR1 flag previous to a GR1 flag which is a decodingtarget is decoded. In other words, there is a problem in that contextindexes regarding the GR1 flag and the GR2 flag at respectivecoefficient positions in a sub-block cannot be derived in parallel.

Hereinafter, in relation to derivation of context indexes for the GR1flag and the GR2 flag in the coefficient level decoding unit 125 a, adescription will be made of an example in which a derivation pattern isselected depending on whether or not a non-zero coefficient is presentin an adjacent sub-block, and context indexes for the GR1 flag and theGR2 flag are derived from a position in a sub-block according to theselected derivation pattern. In this case, the coefficient leveldecoding unit 125 a is provided with an adjacent sub-block coefficientpresence/absence context deriving unit 124 c (not illustrated).

In relation to a process target sub-block X, the following pattern isobtained from a state of a non-zero transform coefficient in a sub-blockA adjacent to the right side of the sub-block X and a sub-block Badjacent to the lower side thereof.

(Pattern 0) A case where a value of a sub-block coefficientpresence/absence flag is 0 in both the right adjacent sub-block (xCG+1,yCG) and the lower adjacent sub-block (xCG, yCG+1)

(Pattern 1) A case where a value of the sub-block coefficientpresence/absence flag is 1 in the right adjacent sub-block (xCG+1, yCG),a value of the sub-block coefficient presence/absence flag is 0 in thelower adjacent sub-block (xCG, yCG+1)

(Pattern 2) A case where a value of the sub-block coefficientpresence/absence flag is 0 in the right adjacent sub-block (xCG+1, yCG),a value of the sub-block coefficient presence/absence flag is 1 in thelower adjacent sub-block (xCG, yCG+1)

(Pattern 3) A case where a value of the sub-block coefficientpresence/absence flag is 1 in both the right adjacent sub-block (xCG+1,yCG) and the lower adjacent sub-block (xCG, yCG+1)

In addition, a pattern index indicating the pattern is obtained by usingthe following Equation (X).

idxCG=significant_coeff_group_flag[xCG+1][yCG]+(significant_coeff_group_flag[xCG][yCG+1]<<1)  (X)

In addition, a context index is derived by using coordinates (xB, yB) inthe sub-block X in a method illustrated in FIG. 41 in accordance withthe pattern index idxCG. With reference to FIG. 41, a description willbe made of a value of a context index which is derived in each case ofthe patterns 0 to 3.

(Case of Pattern 0)

In a case of the pattern 0, a context index is derived bysigCtx=(xB+yB<=2) ? 1:0.

Values of the context indexes are arranged as illustrated in FIG. 42(a).

(Case of Pattern 1)

In a case of the pattern 1, a context index is derived by sigCtx=(yB<=1)? 1:0.

Therefore, as illustrated in FIG. 42( b), values of the context indexesare 1 in the first and second rows of the sub-block, and values of thecontext indexes are 0 in the third and fourth rows of the sub-block.

(Case of Pattern 2)

In a case of the pattern 2, a context index is derived by sigCtx=(xB<=1)? 1:0.

Therefore, as illustrated in FIG. 42( c), values of the context indexesare 1 in the first and second columns of the sub-block, and values ofthe context indexes are 0 in the third and fourth columns of thesub-block.

(Case of Pattern 3)

In a case of the pattern 3, a context index is derived bysigCtx=(xB+yB<=4) ? 2:1.

Therefore, in a case of the pattern 3, if a sum of the coordinate xB inthe horizontal direction and the coordinate yB in the vertical directionof the coordinates (xB, yB) in the sub-block is 4 or less, a value ofthe context index is “1”, and, otherwise, a value of the context indexis “0”.

Therefore, values of the context indexes are arranged as illustrated inFIG. 42( d).

In addition, there may be the following configuration.

With reference to FIGS. 28 and 29, a description thereof will be made.FIG. 28 is a diagram illustrating an example of a pseudo-code forderiving a context index regarding the GR1 flag and the GR2 flag fromcoordinates of a process target frequency component in a sub-blockaccording to a pattern index idxCG. FIG. 29 illustrates arrangements ofvalues of context indexes in a context index derivation method using thepseudo-code illustrated in FIG. 28.

With reference to FIGS. 28 and 29, a description will be made of a valueof a context index which is derived in each case of patterns 0 to 3. Inaddition, hatched parts illustrated in FIG. 29 are parts which arechanged from the arrangements of values of context indexes illustratedin FIG. 42.

(Case of Pattern 0)

In a case of the pattern 0, the adjacent sub-block coefficientpresence/absence context deriving unit 124 c derives a context index asfollows according to a value of xB+yB.

In a case where xB+yB is equal to or smaller than 0, the adjacentsub-block coefficient presence/absence context deriving unit 124 cderives sigCtx=2. In addition, in a case where xB+yB is greater than 1and is equal to or smaller than 2, the adjacent sub-block coefficientpresence/absence context deriving unit 124 c derives sigCtx=1. In othercases, the adjacent sub-block coefficient presence/absence contextderiving unit 124 c derives sigCtx=0. Consequently, values of contextindexes are arranged as illustrated in FIG. 29( a).

(Case of Pattern 1)

In a case of the pattern 1, the adjacent sub-block coefficientpresence/absence context deriving unit 124 c derives a context index asfollows according to a value of yB.

In a case where yB is equal to or smaller than 0, the adjacent sub-blockcoefficient presence/absence context deriving unit 124 c derivessigCtx=2. In addition, in a case where yB is greater than 0 and is equalto or smaller than 1, the adjacent sub-block coefficientpresence/absence context deriving unit 124 c derives sigCtx=1. In othercases, the adjacent sub-block coefficient presence/absence contextderiving unit 124 c derives sigCtx=0. Consequently, values of contextindexes are arranged as illustrated in FIG. 29( b).

In other words, as illustrated in FIG. 29( b), values of the contextindexes are 2 in the first row of the sub-block, and values of thecontext indexes are 1 in the second row of the sub-block. In addition,values of the context indexes are 0 in the third row and the fourth rowof the sub-block.

(Case of Pattern 2)

In a case of the pattern 2, the adjacent sub-block coefficientpresence/absence context deriving unit 124 c derives a context index asfollows according to a value of xB.

In a case where xB is equal to or smaller than 0, the adjacent sub-blockcoefficient presence/absence context deriving unit 124 c derivessigCtx=2. In addition, in a case where xB is greater than 0 and is equalto or smaller than 1, the adjacent sub-block coefficientpresence/absence context deriving unit 124 c derives sigCtx=1. In othercases, the adjacent sub-block coefficient presence/absence contextderiving unit 124 c derives sigCtx=0. Consequently, values of contextindexes are arranged as illustrated in FIG. 29( c).

In other words, as illustrated in FIG. 29( c), values of the contextindexes are 2 in the first column of the sub-block, and values of thecontext indexes are 1 in the second column of the sub-block. Inaddition, values of the context indexes are 0 in the third column andthe fourth column of the sub-block.

(Case of Pattern 3)

In a case of the pattern 3, as illustrated in FIG. 29( d), the adjacentsub-block coefficient presence/absence context deriving unit 124 cequally derives sigCtx=2 in the sub-block regardless of values of xB andyB.

As mentioned above, according to the configuration, it is possible toselect a derivation pattern depending on whether or not a non-zerocoefficient is present in an adjacent sub-block, and to derive contextindexes for the GR1 flag and the GR2 flag from a position in a sub-blockaccording to the selected derivation pattern. For this reason, inrelation to context indexes regarding the GR1 flag and the GR2 flag, itis possible to achieve an effect of deriving the context indexesregarding the GR1 flag and the GR2 flag at respective coefficientpositions in a sub-block in parallel regardless of a GR1 flag previousto a GR1 flag which is a decoding target.

<Flow of Process by Transform Coefficient Decoding Unit 120>

Hereinafter, with reference to FIGS. 23 to 26, a description will bemade of a flow of a process performed by the transform coefficientdecoding unit 120.

FIG. 24 is a flowchart illustrating a flow of a transform coefficientdecoding process performed by the transform coefficient decoding unit120 in a case where a TU size is larger than a predetermined size.

(Step S20)

First, the transform skip/transform/quantization bypass flag decodingunit 128 included in the transform coefficient decoding unit 120 decodesthe syntax transquant_bypass_flag indicating whether or not thetransform/quantization bypass is to be performed and the syntaxtransform_skip_flag indicating whether or not the transform skip is tobe performed. In addition, a specific decoding process has already beendescribed, and thus description thereof will be omitted.

(Step S21)

Next, the coefficient decoding control unit 123 included in thetransform coefficient decoding unit 120 selects a scan type SCanType.

(Step S22)

Next, the last coefficient position decoding unit 121 included in thetransform coefficient decoding unit 120 decodes the syntaxeslast_significant_coeff_x and last_significant_coeff_y indicating aposition of the last transform coefficient according to a scan order.

(Step S23)

Next, the coefficient decoding control unit 123 starts a loop in theunits of sub-blocks. In addition, with a sub-block having the lastcoefficient as a starting position of the loop, a decoding process isperformed in the sub-block units in a backward scan order of a sub-blockscan.

(Step S24)

Next, the sub-block coefficient presence/absence flag decoding unit 127included in the transform coefficient decoding unit 120 decodes thesub-block coefficient presence/absence flagsignificant_coeff_group_flag.

(Step S25)

Next, the coefficient presence/absence flag decoding unit 124 includedin the transform coefficient decoding unit 120 decodes each coefficientpresence/absence flag significant_coeff_flag in a target sub-block.

(Step S26)

Next, the coefficient value decoding unit 125 included in the transformcoefficient decoding unit 120 decodes a sign and a level of a non-zerocoefficient in a target small group. This is performed by the respectivesyntaxes coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag,coeff_sign_flag, and coeff_abs_level_remaining.

(Step S27)

This step is a terminal end of the loop having the sub-block as the unit(a terminal end of the loop having the sub-block of step S23 as theunit).

<<Scan Index Setting Process>>

FIG. 23 is a flowchart more specifically illustrating the process (stepS21) of selecting a scan type.

(Step S111)

First, the coefficient decoding control unit 123 included in thetransform coefficient decoding unit 120 determines whether or notprediction type information PredMode indicates an intra-prediction typeMODE_INTRA.

(Step S112)

If the prediction type is the intra-prediction type (Yes in step S111),the coefficient decoding control unit 123 included in the transformcoefficient decoding unit 120 sets a scan type on the basis of theintra-prediction mode (prediction direction) and a target TU size (asize in a frequency domain). A specific setting process of a scan typehas already been described, and thus description thereof will be omittedhere.

On the other hand, if the prediction type is not the intra-predictiontype (No in step S111), the coefficient decoding control unit 123included in the transform coefficient decoding unit 120 sets a scan typeto the up-right diagonal scan.

<<Decoding Process of Sub-Block Coefficient Presence/Absence Flag>>

FIG. 25 is a flowchart more specifically illustrating the process (stepS24) of decoding the sub-block coefficient presence/absence flag.

The sub-block coefficient presence/absence flag decoding unit 127initializes a value of the sub-block coefficient presence/absence flagsignificant_coeff_group_flag included in a target frequency domainbefore starting a loop of the sub-block. This initialization process isperformed by setting a sub-block coefficient presence/absence flag of asub-block including a DC coefficient and a sub-block coefficientpresence/absence flag of a sub-block including the last coefficient to1, and by setting other sub-block coefficient presence/absence flags to0.

(Step S244)

The sub-block coefficient presence/absence flag decoding unit 127acquires a position of the sub-block.

(Step S247)

The coefficient presence/absence flag decoding unit 127 determineswhether or not the target sub-block is a sub-block including the lastcoefficient or a DC coefficient.

(Step S248)

In a case where the target sub-block is not a sub-block including thelast coefficient or the DC coefficient (No in step S247), thecoefficient presence/absence flag decoding unit 124 decodes thesub-block coefficient presence/absence flagsignificant_coeff_group_flag.

<<Decoding Process on Coefficient Presence/Absence Flag>>

FIG. 26 is a flowchart more specifically illustrating the process (stepS27 of FIG. 24) of decoding each coefficient presence/absence flagsignificant_coeff_flag in the sub-block.

(Step S274)

Next, the coefficient presence/absence flag decoding unit 124 starts aloop in the target sub-block. The loop is a loop having a frequencycomponent as the unit.

(Step S275)

Next, the coefficient presence/absence flag decoding unit 124 acquires aposition of a transform coefficient.

(Step S276)

Next, the coefficient presence/absence flag decoding unit 124 determineswhether or not a non-zero coefficient is present in the targetsub-block.

(Step S277)

In a case where a non-zero coefficient is present in the targetsub-block (Yes in step S276), the coefficient presence/absence flagdecoding unit 124 determines whether or not the position of thetransform coefficient is the last position.

(Step S278)

In a case where the position of the transform coefficient is the lastposition (No in step S277), the coefficient presence/absence flagdecoding unit 124 decodes the coefficient presence/absence flagsignificant_coeff_flag.

(Moving Image Coding Apparatus 2)

With reference to the drawings, a description will be made of aconfiguration of the moving image coding apparatus 2 according to thepresent embodiment. The moving image coding apparatus 2 is a codingapparatus which employs the technique used in the H. 264/MPEG-4 AVCstandard, and the technique proposed in High-Efficiency Video Coding(HEVC) which is a succeeding codec thereof. In the following, the sameparts as described above are given the same reference numerals, anddescription thereof will be omitted.

FIG. 50 is a block diagram illustrating a configuration of the movingimage coding apparatus 2. As illustrated in FIG. 50, the moving imagecoding apparatus 2 includes a predicted image generating unit 21, atransform/quantization unit 22, an inverse quantization/inversetransform unit 23, an adder 24, a frame memory 25, a loop filter 26, avariable length code coding unit 27, and a subtractor 28. In addition,as illustrated in FIG. 50, the predicted image generating unit 21includes an intra-predicted image generating unit 21 a, a motion vectordetecting unit 21 b, an inter-predicted image generating unit 21 c, aprediction type control unit 21 d, and a motion vector redundancydeleting unit 21 e. The moving image coding apparatus 2 is an apparatuswhich codes a moving image #10 (coding target image) so as to generatethe coded data #1.

(Predicted Image Generating Unit 21)

The predicted image generating unit 21 recursively splits a processtarget LCU into one or a plurality of lower CUs, and further splits eachleaf CU into one or a plurality of partitions, so as to generate aninter-predicted image Pred_Inter using inter-frame prediction or anintra-predicted image Pred_Inra using intra-frame prediction. Thegenerated inter-predicted image Pred_Intra and intra-predicted imagePred_Intra are supplied to the adder 24 and the subtractor 28 aspredicted images Pred.

In addition, the predicted image generating unit 21 omits decoding ofother parameters belonging to a PU in relation to the PU to which a skipmode is applied. Further, (1) an aspect of split into lower CUs andpartitions in a target LCU, (2) whether or not a skip mode is applied,and (3) whether an inter-predicted image Pred_Inter or anintra-predicted image Pred_Intra is generated for each partition, aredetermined so as to optimize coding efficiency.

(Intra-Predicted Image Generating Unit 21 a)

The intra-predicted image generating unit 21 a generates a predictedimage Pred_Intra regarding each partition by using intra-frameprediction. Specifically, (1) a prediction mode used forintra-prediction in each partition is selected, and (2) a predictedimage Pred_Intra is generated from a decoded image P by using theselected prediction mode. The intra-predicted image generating unit 21 asupplies the generated intra-predicted image Pred_Intra to theprediction type control unit 21 d.

In addition, the intra-predicted image generating unit 21 a determinesan estimated prediction mode for a target partition from a predictionmode which is assigned to a peripheral partition of the targetpartition, and supplies an estimated prediction mode flag indicatingwhether or not the estimated prediction mode is the same as a predictionmode which is actually selected for the target partition, to thevariable length code coding unit 27 via the prediction type control unit21 d as part of an intra-prediction parameter PP_Intra. The variablelength code coding unit 27 includes the flag in the coded data #1.

Further, in a case where the estimated prediction mode for the targetpartition is different from the prediction mode which is actuallyselected for the target partition, the intra-predicted image generatingunit 21 a supplies a remaining prediction mode index indicating aprediction mode for the target partition, to the variable length codecoding unit 27 via the prediction type control unit 21 d as part of theintra-prediction parameter PP_Intra. The variable length code codingunit 27 includes the remaining prediction mode index in the coded data#1.

In addition, in a case where the predicted image Pred_Intra isgenerated, the intra-predicted image generating unit 21 a selects aprediction mode which causes coding efficiency to be further improved,from among the prediction modes illustrated in FIG. 11, and applies theselected prediction mode.

(Motion Vector Detecting Unit 21 b)

The motion vector detecting unit 21 b detects a motion vector mvregarding each partition. Specifically, (1) an adaptive filtered decodedimage P_ALF′ used as a reference image is selected, and (2) a spacewhich is most approximate to the target partition in the selectedadaptive filtered decoded image P_ALF′ is searched, so that the motionvector mv regarding the target partition is detected. Here, the adaptivefiltered decoded image P_ALF′ is an image obtained by the loop filter 26performing a filter process on a decoded image in which decoding of allframes have already been completed, and the motion vector detecting unit21 b may read a pixel value of each pixel forming the adaptive filtereddecoded image P_ALF′ from the frame memory 25. The motion vectordetecting unit 21 b supplies the detected motion vector mv to theinter-predicted image generating unit 21 c and the motion vectorredundancy deleting unit 21 e along with a reference image index RI fordesignating the adaptive filtered decoded image P_ALF′ used as areference image.

(Inter-Predicted Image Generating Unit 21 c)

The inter-predicted image generating unit 21 c generates a motioncompensation image mc regarding each inter-prediction partition throughinter-frame prediction. Specifically, the motion compensation image mcis generated from the adaptive filtered decoded image P_ALF′ designatedby the reference image index RI which is supplied from the motion vectordetecting unit 21 b, by using the motion vector mv supplied from themotion vector detecting unit 21 b. In the same manner as the motionvector detecting unit 21 b, the inter-predicted image generating unit 21c may read a pixel value of each pixel forming the adaptive filtereddecoded image P_ALF′ from the frame memory 25. The inter-predicted imagegenerating unit 21 c supplies the generated motion compensation image mc(inter-predicted image Pred_Inter) to the prediction type control unit21 d along with the reference image index RI supplied from the motionvector detecting unit 21 b.

(Prediction Type Control Unit 21 d)

The prediction type control unit 21 d compares the intra-predicted imagePred_Intra and the inter-predicted image Pred_Inter with a coding targetimage, and selects whether intra-prediction or inter-prediction isperformed. In a case where the intra-prediction is selected, theprediction type control unit 21 d supplies the intra-predicted imagePred_Intra to the adder 24 and the subtractor 28 as a predicted imagePred, and also supplies the intra-prediction parameter PP_Intra which issupplied from the intra-predicted image generating unit 21 a, to thevariable length code coding unit 27. On the other hand, in a case wherethe inter-prediction is selected, the prediction type control unit 21 dsupplies the inter-predicted image Pred_Inter to the adder 24 and thesubtractor 28 as a predicted image Pred, and also supplies, to thevariable length code coding unit 27, the reference image index RI, andan estimated motion vector index PMVI and a motion vector difference MVDwhich are supplied from the motion vector redundancy deleting unit 21 edescribed later, as inter-prediction parameters PP_Inter. In addition,the prediction type control unit 21 d supplies prediction typeinformation Pred_type indicating which one of the intra-predicted imagePred_Intra and the inter-predicted image Pred_Inter has been selected,to the variable length code coding unit 27.

(Motion Vector Redundancy Deleting Unit 21 e)

The motion vector redundancy deleting unit 21 e deletes redundancy fromthe motion vector mv which has been detected by the motion vectordetecting unit 21 b. Specifically, (1) an estimation method used toestimate the motion vector mv is selected, (2) an estimated motionvector pmv is derived according to the selected estimation method, and(3) the motion vector difference MVD is generated by subtracting theestimated motion vector pmv from the motion vector mv. The motion vectorredundancy deleting unit 21 e supplies the generated motion vectordifference MVD to the prediction type control unit 21 d along with theestimated motion vector index PMVI indicating the selected estimationmethod.

(Transform/Quantization Unit 22)

In a normal case (the transform skip is not performed(transform_skip_flag==0), and the transform/quantization bypass is notperformed (transquant_bypass_flag==0)), the transform/quantization unit22 (1) performs frequency transform such as discrete cosine transform(DCT) on a prediction residual D obtained by subtracting the predictedimage Pred from the coding target image, for each block (transformunit), (2) quantizes a transform coefficient Coeff_IQ which is obtainedthrough the frequency transform, and (3) supplies the transformcoefficient Coeff obtained through the quantization to the variablelength code coding unit 27 and the inverse quantization/inversetransform unit 23. In addition, in a case where the transform skip is tobe performed (transform_skip_flag==1), the transform/quantization unit22 (1) supplies a prediction residual D obtained by subtracting thepredicted image Pred from the coding target image, for each block(transform unit), to the variable length code coding unit 27 and theinverse quantization/inverse transform unit 23. Further, in a case wherethe transform skip is performed (transform_skip_flag==1), thetransform/quantization unit 22 (1) quantizes a prediction residual Dobtained by subtracting the predicted image Pred from the coding targetimage, for each block (transform unit), and (2) supplies the transformcoefficient Coeff (quantized prediction residual D) obtained through thequantization to the variable length code coding unit 27 and the inversequantization/inverse transform unit 23.

In addition, the transform/quantization unit 22 (1) selects aquantization step QP used for the quantization for each TU, (2) suppliesa quantization parameter difference Δqp indicating a size of theselected quantization step QP to the variable length code coding unit27, and (3) supplies the selected quantization step QP to the inversequantization/inverse transform unit 23. Here, the quantization parameterdifference Δqp indicates a difference value obtained by subtracting avalue of a quantization parameter qp′ regarding a TU which haspreviously undergone frequency transform and quantization from aquantization parameter qp (for example, QP=2^(qP/6)) regarding a TUwhich undergoes frequency transform and quantization.

In addition, the transform/quantization unit 22 determines whether ornot the transform skip is to be performed and the transform/quantizationbypass is to be performed. In a case where the transform skip is to beperformed, a value of the transform skip flag (transform_skip_flag) isset to 1. In a case where the transform skip is not to be performed, avalue of the transform skip flag is set to 0. Further, in a case wherethe transform/quantization bypass is to be performed, thetransform/quantization bypass flag (transquant_bypass_flag) is set to 1.In a case where the transform/quantization bypass is to be performed,the transform/quantization bypass flag is set to 0. Furthermore, thetransform skip flag and the transform/quantization bypass flag aresupplied to the variable length code coding unit 27 and the inversequantization/inverse transform unit 23.

In addition, the DCT performed by the transform/quantization unit 22 isgiven by, for example, the following Equation (2) in a case where a sizeof a target block is 8×8 pixels, and an unquantized transformcoefficient for a horizontal frequency u and a vertical frequency v isdenoted by Coeff_IQ(u, v) (where 0≦u≦7 and 0≦v≦7).

$\begin{matrix}{\mspace{79mu} \lbrack {{Math}.\mspace{14mu} 2} \rbrack} & \; \\{{{Coeff\_ IQ}( {u,v} )} = {\frac{1}{4}{C(u)}{C(v)}{\sum\limits_{u = 0}^{7}\; {\sum\limits_{v = 0}^{7}{{D( {i,j} )}\cos \{ \frac{( {{2i} + 1} )u\; \pi}{16} \} \cos \{ \frac{( {{2j} + 1} )v\; \pi}{16} \}}}}}} & (2)\end{matrix}$

Here, D(i, j) (where 0≦i≦7 and 0≦j≦7) indicates a prediction residual Dat a position (i, j) in a target block. In addition, C(u) and C(v) aregiven as follows.

C(u)=1/√2 (u=0)

C(u)=1 (u≠0)

C(v)=1/√2 (v=0)

C(v)=1 (v≠0)

In addition, in a case where the transform skip is performed, frequencytransform is not performed, and thus the prediction residual D(i, j) atposition (i, j) of the pixel in the corresponding target block isequivalent to the unquantized transform coefficient Coeff_IQ(u, v) as inthe following equation.

Coeff_IQ(u,v)=D(i,j) (where i=u and j=v)

In addition, in a case where the transform/quantization bypass isperformed, frequency transform and quantization are not performed, andthus the prediction residual D(i, j) at the position (i, j) of the pixelin the corresponding target block is equivalent to the transformcoefficient Coeff (u, v) as in the following equation.

Coeff(u,v)=D(i,j) (where u=i and v=j)

(Inverse Quantization/Inverse Transform Unit 23)

In a normal case (the transform skip is not performed(transform_skip_flag==0), and the transform/quantization bypass is notperformed (transquant_bypass_flag==0)), the inverse quantization/inversetransform unit 23 (1) inversely quantizes the quantized transformcoefficient Coeff, (2) performs inverse frequency transform such asinverse discrete cosine transform (DCT) on a transform coefficientCoeff_IQ obtained through the inverse quantization, and (3) supplies aprediction residual D obtained through the inverse frequency transformto the adder 24. In addition, in a case where the transform/quantizationbypass is performed (transquant_bypass_flag==1), the inversequantization/inverse transform unit 23 (1) supplies the transformcoefficient Coeff (equivalent to the prediction residual D) to the adder24. Further, in a case where the transform skip is performed(transform_skip_flag==1), the inverse quantization/inverse transformunit 23 (1) inversely quantizes the quantized transform coefficientCoeff (equivalent to the quantized prediction residual D), and (2)supplies the transform coefficient Coeff_IQ (equivalent to theprediction residual D) obtained through the inverse quantization to theadder 14. The quantization step QP which is supplied from thetransform/quantization unit 22 is used to inversely quantize thequantized transform coefficient Coeff. In addition, the predictionresidual D which is output from the inverse quantization/inversetransform unit 23 is obtained by adding a quantization error to theprediction residual D which is input to the transform/quantization unit22, but, here, for simplification, the common name is used. Morespecific operations of the inverse quantization/inverse transform unit23 are substantially the same as the inverse quantization/inversetransform unit 13 included in the moving image decoding apparatus 1.

(Adder 24)

The adder 24 adds the predicted image Pred selected in the predictiontype control unit 21 d to the prediction residual D generated in theinverse quantization/inverse transform unit 23, so as to generate a(local) decoded image P. The generated (local) decoded image P generatedin the adder 24 is supplied to the loop filter 26 and is also stored inthe frame memory 25 so as to be used as a reference image inintra-prediction.

(Variable Length Code Coding Unit 27)

The variable length code coding unit 27 performs variable length codingon (1) the quantized transform coefficient Coeff and Δqp which aresupplied from the transform/quantization unit 22, (2) the quantizationparameters PP (the inter-predicted image PP_Inter and theintra-predicted image PP_Intra) supplied from the prediction typecontrol unit 21 d, (3) the prediction type information Pred_type, and(4) a filter parameter FP supplied from the loop filter 26, so as togenerate the coded data #1.

FIG. 51 is a block diagram illustrating a configuration of the variablelength code coding unit 27. As illustrated in FIG. 51, the variablelength code coding unit 27 includes a quantized residual informationcoding unit 271 which codes the quantized transform coefficient Coeff, aprediction parameter coding unit 272 which codes the predictionparameter PP, a prediction type information coding unit 273 which codesthe prediction type information Pred_type, and a filter parameter codingunit 274 which codes the filter parameter FP. A specific configurationof the quantized residual information coding unit 271 will be describedlater, and thus description thereof will be omitted here.

(Subtractor 28)

The subtractor 28 subtracts the predicted image Pred selected in theprediction type control unit 21 d from the coding target image so as togenerate the prediction residual D. The prediction residual D generatedin the subtractor 28 undergoes frequency transform and quantization inthe transform/quantization unit 22.

(Loop Filter 26)

The loop filter 26 functions (1) as a deblocking filter (DF) whichperforms smoothing (deblock process) on a peripheral image on a blockboundary or a partition boundary in the decoded image P, and (2) as anadaptive loop filter (ALF) of performing an adaptive filter process onthe image to which the deblocking filter has been applied, by using thefilter parameter FP.

(Quantized Residual Information Coding Unit 271)

The quantized residual information coding unit 271 performscontext-based adaptive binary arithmetic coding (CABAC) on the quantizedtransform coefficient Coeff (xC, yC) so as to generate quantizedresidual information QD. Syntaxes included in the quantized residualinformation QD which is generated are as described above.

In addition, xC and yC are indexes indicating a position of eachfrequency component in a frequency domain, and are indexes correspondingto the above-described horizontal frequency u and vertical frequency v.Further, hereinafter, the quantized transform coefficient Coeff issimply referred to as a transform coefficient Coeff in some cases.

(Quantized Residual Information Coding Unit 271)

FIG. 52 is a block diagram illustrating a configuration of the quantizedresidual information coding unit 271. As illustrated in FIG. 52, thequantized residual information coding unit 271 includes a transformcoefficient coding unit 220 and an arithmetic code coding unit 230.

(Arithmetic Code Coding Unit 230)

The arithmetic code coding unit 230 codes each Bin supplied from thetransform coefficient coding unit 220 by referring to a context, so asto generate the quantized residual information QD, and includes acontext recording/updating unit 231 and a bit coding unit 232 asillustrated in FIG. 52.

(Context Recording/Updating Unit 231)

The context recording/updating unit 231 has a configuration forrecording and updating a context variable CV which is managed by eachcontext index ctxIdx. Here, the context variable CV includes (1) asuperior symbol MPS (most probable symbol) of which an occurrenceprobability is high, and (2) a probability state index pStateIdx fordesignating an occurrence probability of the superior symbol MPS.

The context recording/updating unit 231 updates the context variable CVby referring to the context index ctxIdx supplied from each constituentelement included in the transform coefficient coding unit 220 and avalue of a Bin coded by the bit coding unit 232, and records the updatedcontext variable CV until the context variable is updated next. Inaddition, the superior symbol MPS is 0 or 1. Further, the superiorsymbol MPS and the probability state index pStateIdx are updatedwhenever the bit coding unit 232 decodes a single Bin.

In addition, the context index ctxIdx may directly designate context foreach frequency component (or each pixel), and may be an increment valuefrom an offset of a context index which is set for each process targetTU (this is also the same for the following).

(Bit Coding Unit 232)

The bit coding unit 232 codes each Bin supplied from each constituentelement included in the transform coefficient coding unit 220 byreferring to the context variable CV which is recorded in the contextrecording/updating unit 231, so as to generate the quantized residualinformation QD. In addition, a value of the coded Bin is also suppliedto the context recording/updating unit 231 so as to be referred to forupdating the context variable CV.

(Transform Coefficient Coding Unit 220)

As illustrated in FIG. 52, the transform coefficient coding unit 220includes a last coefficient position coding unit 221, a scan order tablestorage unit 222, a coefficient coding control unit 223, a coefficientpresence/absence flag coding unit 224, a coefficient value coding unit225, a coded coefficient storage unit 226, a sub-block coefficientpresence/absence flag coding unit 227, a transformskip/transform/quantization bypass flag coding unit 228, and a syntaxderiving unit 229.

[Transform Skip/Transform/Quantization Bypass Flag Coding Unit 228]

The transform skip/transform/quantization bypass flag coding unit 228generates Bins indicating the syntaxes, the transform skip flagtransform_skip_flag, and the transform/quantization bypass flagtransquant_bypass_flag, supplied from the transform/quantization unit22. In addition, the generated each Bin is supplied to the bit codingunit 232. Further, a context index ctxIdx for designating a contextwhich is referred to for coding the Bins of the syntaxestransform_skip_flag and transquant_bypass_flag is supplied to thecontext recording/updating unit 231.

<<Coding Process 1 of Transform/Quantization Bypass Flag and TransformSkip Flag>>

Hereinafter, with reference to FIG. 53, a coding process of thetransform/quantization bypass flag and the transform skip flag will bedescribed in detail. In addition, the coding process 1 is a processcorresponding to the decoding process 1 of the transform/quantizationbypass flag and the transform skip flag in the transformskip/transform/quantization bypass flag decoding unit 128 included inthe moving image decoding apparatus 1.

FIG. 53( a) illustrates syntax examples of the transform/quantizationbypass flag and the transform skip flag, and FIG. 53( b) is a flowchartmore specifically illustrating the decoding process.

(Step S20-1)

First, the transform skip/transform/quantization bypass flag coding unit228 determines whether or not the transform/quantization bypass enabledflag (transquant_bypass_enabled_flag) which is input from an externaldevice is 1. In a case where the transform/quantization bypass enabledflag is 1 (Yes in step S20-1), the flow proceeds to step S20-2A. Inother cases (No in step S20-1), the flow proceeds to step S20-3A.

(Step S20-2A)

The transform skip/transform/quantization bypass flag coding unit 228explicitly codes the transform/quantization bypass flagtransquant_bypass_flag in relation to a target TU, and the flow proceedsto step S20-4.

(Step S20-3)

The transform skip/transform/quantization bypass flag coding unit 228implicitly interprets the transform/quantization bypass flag(transquant_bypass_flag) as 0 in relation to the TU and skips coding ofthe transform/quantization bypass flag, and the flow proceeds to stepS20-4.

(Step S20-4)

The transform skip/transform/quantization bypass flag coding unit 228determines whether or not the transform skip enabled flag(transform_skip_enabled_flag) which is input from an external deviceis 1. In a case where the transform skip enabled flag is 1 (Yes in stepS20-4), the flow proceeds to step S20-5. In other cases (No in stepS20-4), the flow proceeds to step S20-7A.

(Step S20-5)

The transform skip/transform/quantization bypass flag coding unit 228determines whether or not the transform bypass flag is 0. In a casewhere the transform bypass flag is 0 (Yes in step S20-5), the flowproceeds to step S20-6A. In other cases, the flow proceeds to stepS20-7A.

(Step S20-6A)

The transform skip/transform/quantization bypass flag coding unit 228explicitly codes the transform skip flag (transform_skip_flag) inrelation to the target TU.

(Step S20-7A)

The transform skip/transform/quantization bypass flag coding unit 228implicitly interprets the transform/quantization bypass flag(transquant_bypass_flag) as 0 in relation to the TU and skips coding ofthe transform skip flag.

In addition, a coding process of the transform skip flag and thetransform/quantization bypass flag is not limited to the above-describedprocedures, and procedures may be changed in a scope in which theprocess can be performed.

For example, as illustrated in FIG. 54, after step S20-5, it may bedetermined that a TU size is smaller than a predetermined size (stepS20-8), and the flow may proceed to step S20-6A or step S20-7A.

As mentioned above, according to the transformskip/transform/quantization bypass flag coding unit 228, when comparedwith the related art (refer to FIG. 55), whether or not the transformskip is performed can be appropriately selected for each TU regardlessof a TU size or a prediction mode. For this reason, since a code amountof transform coefficients regarding a TU which is a coding and decodingtarget can be reduced, a processing amount is reduced, and codingefficiency is improved. In addition, since a branch process regardingwhether or not the transform skip flag is decoded can be reduced, aprocessing amount related to coding of a transform coefficient can bereduced.

[Syntax Deriving Unit 229]

The syntax deriving unit 229 refers to each value of the transformcoefficient Coeff (xC, yC), and derives each value of the syntaxeslast_significant_coeff_x, last_significant_coeff_y,significant_coeff_flag, coeff_abs_level_greater1_flag,coeff_abs_level_greater2_flag, coeff_sign_flag, andcoeff_abs_level_remaining, for specifying the transform coefficient in atarget frequency domain. The derived each syntax is supplied to thecoded coefficient storage unit 226. In addition, among the derivedsyntaxes, last_significant_coeff_x and last_significant_coeff_y are alsosupplied to the coefficient coding control unit 223 and the lastcoefficient position coding unit 221. Further, among the derivedsyntaxes, significant_coeff_flag is also supplied to the coefficientpresence/absence flag coding unit 224. Furthermore, the contentindicated by each syntax has been described above, and thus descriptionthereof will be omitted here.

(Configuration Example of Coefficient Value Syntax Deriving Unit 2285)

The syntax deriving unit 229 is provided with a coefficient value syntaxderiving unit 2285 (not illustrated). The coefficient value syntaxderiving unit 2285 derives each value of significant_coeff_flag,coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag,coeff_sign_flag, and coeff_abs_level_remaining.

FIG. 58 is a block diagram illustrating a configuration example of thecoefficient value syntax deriving unit 2285. As illustrated in FIG. 58,the coefficient value syntax deriving unit 2285 includes a coefficientlevel syntax deriving unit 225 a, a coefficient sign syntax derivingunit 225 b, and a coefficient number deriving unit 125 d. Thecoefficient sign syntax deriving unit 225 b includes a coefficientposition deriving unit 125 e, a sign hiding flag deriving unit 125 f, asign syntax deriving and a level value correcting unit 225 h, and acoefficient sum calculating unit 125 g. The coefficient number derivingunit 125 d, the coefficient position deriving unit 125 e, the signhiding flag deriving unit 125 f, and the coefficient sum calculatingunit 125 g have the same functions as the blocks with the same namesdescribed in the moving image decoding apparatus 1, and thus descriptionthereof will be omitted here.

The coefficient level syntax deriving unit 225 a derives the syntaxescoeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, andcoeff_abs_level_remaining by referring to each value of the transformcoefficient Coeff (xC, yC).

The coefficient sign syntax deriving unit 225 b derives coeff_sign_flagby referring to each value of the transform coefficient Coeff (xC, yC).The sign syntax deriving and a level value correcting unit 225 h derivescoeff_sign_flag of the number obtained by subtracting 1 from the numberof sub-blocks in a case where it is determined that sign hiding is to beperformed in the sign hiding flag deriving unit 225 f. In a case wherethe sign hiding is not to be performed, coeff_sign_flag of the number ofsub-blocks is derived.

In addition, in a case where it is determined that the sign hiding is tobe performed, the sign syntax deriving and a level value correcting unit225 h compares a sign of a transform coefficient at a positionfirstNZPosInCG of the initial non-zero coefficient in a scan order ineach sub-block with a sign defined by a coefficient sum sumAbs derivedfrom the coefficient sum calculating unit 125 g. If the two signs arethe same as each other, a value of a target transform coefficient is notcorrected. If the two signs are different from each other, correction isperformed by setting an absolute value of any one of transformcoefficients in a target sub-block to −1 or +1. In a case where it isdetermined that the sign hiding is not to be performed, this correctionis not performed.

[Last Coefficient Position Coding Unit 221]

The last coefficient position coding unit 221 generates Bins indicatingthe syntaxes last_significant_coeff_x and last_significant_coeff_ysupplied from the syntax deriving unit 228. In addition, the generatedeach Bin is supplied to the bit coding unit 232. Further, a contextindex ctxIdx for designating a context which is referred to for codingthe Bins of the syntaxes last_significant_coeff_x andlast_significant_coeff_y is supplied to the context recording/updatingunit 231.

[Scan Order Table Storage Unit 222]

The scan order table storage unit 222 stores a table which provides aposition of a process target frequency component in a frequency domain,or a position of a pixel in a process target pixel domain, by using asize of a process target TU (block), a scan index indicating the type ofscan direction, and a frequency component identification index which isgiven according to a scan order, as arguments. An example of such a scanorder table may include ScanOrder illustrated in FIGS. 7 and 8.

In addition, the scan order table storage unit 222 stores a sub-blockscan order table for designating a scan order of sub-blocks. Here, thesub-block scan order table is designated by a size of a process targetTU (block) and the scan index scanIdx associated with a prediction modeindex of an intra-prediction mode.

The scan order table and sub-block scan order table stored in the scanorder table storage unit 222 are the same as those stored in the scanorder table storage unit 122 of the moving image decoding apparatus 1,and thus description thereof will be omitted here.

[Coefficient Coding Control Unit 223]

The coefficient coding control unit 223 has a configuration forcontrolling an order of a coding process in each constituent elementincluded in the quantized residual information coding unit 271.

The coefficient coding control unit 223 specifies a position of the lastnon-zero coefficient according to a forward scan by referring to thesyntaxes last_significant_coeff_x and last_significant_coeff_y suppliedfrom the syntax deriving unit 228, and supplies a position (xCG, yCG) ofeach sub-block to the sub-block coefficient presence/absence flag codingunit 227 in a backward scan order of a scan order which uses thespecified position of the last non-zero coefficient as a starting pointand is given by the sub-block scan order table stored in the scan ordertable storage unit 222.

Further, in relation to a process target sub-block, the coefficientcoding control unit 223 supplies a position (xC, yC) of each frequencycomponent included in the process target sub-block to the coefficientpresence/absence flag coding unit 224 in a backward scan order given bythe scan order table stored in the scan order table storage unit 222.Here, as a scan order of each coefficient position (each frequencycomponent or each pixel) included in the process target sub-block, in acase of intra-prediction, a scan order (any one of the horizontal fastscan, the vertical fast scan, and the up-right diagonal scan) indicatedby a scan index scanIdx which is designated by the intra-prediction modeindex IntraPredMode and a value log 2TrafoSize for designating a TU sizemay be used, and, in a case of inter-prediction, the up-right diagonalscan may be used.

As mentioned above, the coefficient coding control unit 223 changes ascan order for each intra-prediction mode. Generally, since anintra-prediction mode and a bias of a transform coefficient arecorrelated with each other, a scan order is changed according to theintra-prediction mode, and a scan suitable for biases of the sub-blockcoefficient presence/absence flag and the coefficient presence/absenceflag can be performed. Consequently, it is possible to reduce a codeamount of the sub-block coefficient presence/absence flag and thecoefficient presence/absence flag which are coding and decoding targets,and thus to reduce a processing amount and to improve coding efficiency.

[Coefficient Value Coding Unit 225]

The coefficient value coding unit 225 generates Bins indicating thesyntaxes coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag,coeff_sign_flag, and coeff_abs_level_remaining, supplied from the syntaxderiving unit 228. In addition, each generated Bin is supplied to thebit coding unit 232. Further, the context index ctxIdx for designating acontext which is referred to for coding the Bins of the syntaxes issupplied to the context recording/updating unit 231. Furthermore,decoding processes of the GR1 flag (coeff_abs_level_greater1_flag), theGR2 flag (coeff_abs_level_greater2_flag), and the remaining coefficientlevel (coeff_abs_level_remaining) in a coefficient level coding unitcorresponding to the coefficient level decoding unit 125 a included inthe moving image decoding apparatus 1 will be described later.

[Coefficient Presence/Absence Flag Coding Unit 224]

The coefficient presence/absence flag coding unit 224 according to thepresent embodiment codes the syntax significant_coeff_flag[xC][yC]designated by each position (xC, yC). More specifically, a Binindicating the syntax significant_coeff_flag[xC][yC] designated by eachposition (xC, yC) are generated. The generated Bin is supplied to thebit coding unit 232. In addition, the coefficient presence/absence flagcoding unit 224 calculates the context index ctxIdx for determining acontext which is used for the arithmetic code coding unit 230 to codethe Bin of the syntax significant_coeff_flag[xC][yC]. The calculatedcontext index ctxIdx is supplied to the context recording/updating unit231.

FIG. 56 is a block diagram illustrating a configuration of thecoefficient presence/absence flag coding unit 224. As illustrated inFIG. 56, the coefficient presence/absence flag coding unit 224 includesa context deriving means selecting unit 224 a, a position contextderiving unit 224 b, an adjacent sub-block coefficient presence/absencecontext deriving unit 224 c, a transform skip/transform/quantizationbypass context deriving unit 224 d, and a coefficient presence/absenceflag setting unit 224 e.

(Context Deriving Means Selecting Unit 224 a)

A frequency component or a pixel position (also referred to as acoefficient position) (xC, yC) which is a process target, andlogarithmic values (log 2TrafoWidth and log 2TrafoHeight) of a transformblock are input to the context deriving means selecting unit 224 a. Onthe basis of the logarithmic value sizes, a width and a height of thetransform block is calculated by using (1<<log 2TrafoWidth) and (1>>log2Trafo Height). In addition, instead of the logarithmic value sizes, awidth and a height of the transform block may be directly input.Further, the transform skip flag (transform_skip_flag) and thetransform/quantization bypass flag (transquant_bypass_flag) are input tothe context deriving means selecting unit 224 a.

The context deriving means selecting unit 224 a selects the positioncontext deriving unit 224 b, the adjacent sub-block coefficientpresence/absence context deriving unit 224 c, or the transformskip/transform/quantization bypass context deriving unit 224 d, inaccordance with a transform skip flag, a transform/quantization bypassflag, a target TU size, and a position of a decoding target coefficient.The selected context deriving unit derives a context index ctxIdx.

A specific process in the context deriving means selecting unit 224 a isthe same as that in the context deriving means selecting unit 124 aincluded in the moving image decoding apparatus 1, and thus descriptionthereof will be omitted here.

(Position Context Deriving Unit 224 b)

The position context deriving unit 224 b derives a context index ctxIdxfor a target frequency component on the basis of a position of thetarget frequency component in a frequency domain.

Other specific processes in the position context deriving unit 224 b arethe same as those in the position context deriving unit 124 b includedin the moving image decoding apparatus 1, and thus description thereofwill be omitted here.

(Adjacent Sub-Block Coefficient Presence/Absence Context Deriving Unit224 c)

The adjacent sub-block coefficient presence/absence context derivingunit 224 c selects a context derivation pattern according to whether ornot a non-zero coefficient is present in an adjacent sub-block, andderives a context index for a decoding target frequency component fromcoordinates of the process target frequency component in a sub-blockaccording to the selected derivation pattern. A specific process in theadjacent sub-block coefficient presence/absence context deriving unit224 c is the same as that in the adjacent sub-block coefficientpresence/absence context deriving unit 224 c included in the movingimage decoding apparatus 1, and thus description thereof will be omittedhere.

(Transform Skip/Transform/Quantization Bypass Context Deriving Unit 224d)

The transform skip/transform/quantization bypass context deriving unit224 d derives a context index ctxIdx for a coefficient in a pixel domainof a target transform block on the basis of a predetermined methodduring the transform skip or the transform/quantization bypass.

A specific process in the transform skip/transform/quantization bypasscontext deriving unit 224 d is the same as that in the transformskip/transform/quantization bypass context deriving unit 124 d includedin the moving image decoding apparatus 1, and thus description thereofwill be omitted here.

(Coefficient Presence/Absence Flag Setting Unit 224 e)

The coefficient presence/absence flag setting unit 224 e generates a Binindicating the syntax significant_coeff_flag[xC][yC] supplied from thesyntax deriving unit 228. The generated Bin is supplied to the bitcoding unit 232. In addition, the coefficient presence/absence flagsetting unit 224 e refers to a value of significant_coeff_flag[xC][yC]included in a target sub-block, sets a value ofsignificant_coeff_group_flag[xCG][yCG] regarding the sub-block to 0 in acase where all values of significant_coeff_flag[xCG][yCG] are 0, thatis, a non-zero coefficient is not included in the target sub-block, and,otherwise, sets a value of significant_coeff_group_flag[xCG][yCG]regarding the target sub-block to 1.significant_coeff_group_flag[xCG][yCG] given the values as mentionedabove is supplied to the sub-block coefficient presence/absence flagcoding unit 227.

<<Another Configuration Example of Coefficient Presence/Absence FlagCoding Unit 224>>

Hereinafter, with reference to FIG. 61, another configuration example ofthe coefficient presence/absence flag coding unit 224 will be described.

FIG. 61 is a block diagram illustrating another configuration example ofthe coefficient presence/absence flag coding unit 224. As illustrated inFIG. 61, the coefficient presence/absence flag coding unit 224 includesa context deriving means selecting unit 224Aa, a position contextderiving unit 224 b, an adjacent sub-block coefficient presence/absencecontext deriving unit 224 c, a transform skip context deriving unit224Ad, and a coefficient presence/absence flag setting unit 224 e. Inaddition, the position context deriving unit 224 b, the adjacentsub-block coefficient presence/absence context deriving unit 224 c, andthe coefficient presence/absence flag setting unit 224 e have the samefunctions as the corresponding constituent elements of FIG. 56 and arethus given the same reference numerals, and description thereof will beomitted.

(Context Deriving Means Selecting Unit 224Aa)

At least a process target coefficient position (xC, yC), logarithmicvalues (log 2TrafoWidth and log 2TrafoHeight) of a transform block size,and a transform_skip_flag (transform_skip_flag) are input to the contextderiving means selecting unit 224Aa.

The context deriving means selecting unit 224Aa selects the positioncontext deriving unit 224 b, the adjacent sub-block coefficientpresence/absence context deriving unit 224 c, or the transform skipcontext deriving unit 224Ad, in accordance with the transform_skip_flag,the target transform block size, and the target coefficient position.The selected context deriving unit derives a context index ctxIdx whichis referred to when a coefficient presence/absence flag at the targetcoefficient position is decoded. In addition, a context deriving meanselecting process in the context deriving means selecting unit 224Aa isthe same as that in the context deriving means selecting unit 124Aaincluded in the moving image decoding apparatus 1, and thus descriptionthereof will be omitted here.

(Transform Skip Context Deriving Unit 224Ad)

The transform skip context deriving unit 224Ad derives a context(context index ctxIdx) which is referred to when a coefficientpresence/absence flag in a target coefficient is decoded during thetransform skip. The context derived here is a single context regardlessof a position of the target coefficient in a sub-block. In addition, aspecific process in the transform skip context deriving unit 224Ad isthe same as that in the transform skip context deriving unit 124Adincluded in the moving image decoding apparatus 1, and thus descriptionthereof will be omitted here.

(Sub-Block Coefficient Presence/Absence Flag Coding Unit 227)

The sub-block coefficient presence/absence flag coding unit 227 codesthe syntax significant_coeff_group_flag[xCG][yCG] designated by eachsub-block position (xCG, yCG). More specifically, a Bin indicatingsyntax significant_coeff_group_flag[xCG][yCG] designated by eachsub-block position (xCG, yCG) is generated. The generated Bin issupplied to the bit coding unit 232. In addition, the sub-blockcoefficient presence/absence flag coding unit 227 calculates the contextindex ctxIdx for determining a context which is used for the arithmeticcode coding unit 230 to code the Bin of the syntaxsignificant_coeff_flag[xC][yC]. The calculated context index ctxIdx issupplied to the context recording/updating unit 231.

FIG. 57 is a block diagram illustrating a configuration of the sub-blockcoefficient presence/absence flag coding unit 227. As illustrated inFIG. 57, the sub-block coefficient presence/absence flag coding unit 227includes a context deriving unit 227 a, a sub-block coefficientpresence/absence flag storage unit 227 b, and a sub-block coefficientpresence/absence flag setting unit 227 c.

Hereinafter, a description will be described by exemplifying a casewhere the sub-block position (xCG, yCG) is supplied from the coefficientcoding control unit 223 to the sub-block coefficient presence/absenceflag coding unit 227 in a forward scan order. In addition, in this case,the sub-block position (xCG, yCG) is preferably supplied to thesub-block coefficient presence/absence flag decoding unit 127 includedin the moving image decoding apparatus 1 in a backward scan order.

(Context Deriving Unit 227 a)

The context deriving unit 227 a included in the sub-block coefficientpresence/absence flag coding unit 227 derives a context index assignedto a sub-block which is designated by each sub-block position (xCG,yCG). The context index assigned to a sub-block is used to decode a Binindicating the syntax significant_coeff_group_flag for the sub-block. Inaddition, in a case where the context index is derived, a value of thesub-block coefficient presence/absence flag stored in the sub-blockcoefficient presence/absence flag storage unit 227 b is referred to. Thecontext deriving unit 227 a supplies the derived context index to thecontext recording/updating unit 231.

(Sub-Block Coefficient Presence/Absence Flag Storage Unit 227 b)

The sub-block coefficient presence/absence flag storage unit 227 bstores each value of the syntax significant_coeffgroup_flag suppliedfrom the coefficient presence/absence flag coding unit 224. Thesub-block coefficient presence/absence flag setting unit 227 c may readthe syntax significant_coeff_group_flag assigned to an adjacentsub-block from the sub-block coefficient presence/absence flag storageunit 227 b.

(Sub-Block Coefficient Presence/Absence Flag Setting Unit 227 c)

The sub-block coefficient presence/absence flag setting unit 227 cgenerates a Bin indicating the syntaxsignificant_coeff_group_flag[xCG][yCG] supplied from the coefficientpresence/absence flag coding unit 224. The generated Bin is supplied tothe bit coding unit 232.

Hereinafter, a description will be made of coding processes of the GR1flag, the GR2 flag, and a remaining coefficient level in the coefficientvalue coding unit 225 corresponding to the coefficient level decodingunit 125 a included in the moving image decoding apparatus 1.

(Coding Process of GR1 Flag)

Hereinafter, a description will be made of a coding process of the GR1flag performed by the coefficient value coding unit 225. FIG. 38 is aflowchart illustrating the coding process of the GR1 flag.

(Step SD201)

The coefficient value coding unit 225 initializes various parametersrelated to the decoding of the GR1 flag.

A coefficient position identification index n is set to 15 (n=15).

A coefficient number numSigCoeff is set to 0 (numSigCoeff=0).

A coefficient position firstGreater1CoeffIdx at which a value of the GR1flag initially appearing in a sub-block is 1 is set to −1(firstGreatr1CoeffIdx=−1).

In a case where a position (subset) of a coding target sub-blockcorresponds to a sub-block including the last coefficient, a variablegreatr1Ctx indicating the number of coded GR1 flags having a value of 0is initialized to 1 (that is, greater1Ctx=1).

In addition, in a case where a position (subset) of the coding targetsub-block corresponds to a sub-block which does not include the lastcoefficient, the variable greatr1Ctx indicating the number of coded GR1flags having a value of 0 is updated by using the following equation.

greater1Ctx=greater1Ctx>>1

(Step SD202)

A loop in a target sub-block is started. The loop is a loop having acoefficient position as the unit.

(Step SD203)

It is determined whether or not a coefficient position (xC, yC)specified by the coefficient position identification index n is anon-zero coefficient. In a case of the non-zero coefficient(significant_coeff_flag[xC][yC]==1) (Yes in step SD203), the flowproceeds to step SD204. In other cases(significant_coeff_flag[xC][yC]==0) (No in step SD203), the flowproceeds to step SD209.

(Step SD204)

It is determined whether or not the number numSigCoeff of the GR1 flagswhich are coded in the sub-block is equal to or smaller than apredetermined threshold value. In a case where the number numSigCoeff ofthe GR1 flags which are decoded in the sub-block is equal to or smallerthan the predetermined threshold value (Yes in step SD104), the flowproceeds to step SD204. In other cases (No in step S204), the flowproceeds to step SD209.

(Step SD205)

The GR1 flag of the coefficient position identification index n iscoded. In addition, a derivation method of a context index which isreferred to for coding the GR1 flag is the same as the derivation methodof a context index which is referred to for decoding the GR1 flag, andthus description thereof will be omitted. However, in the derivationmethod of a context index for decoding the GR1 flag, the term “decoding”is replaced with the term “coding”.

(Step SD206)

The number of coded GR1 flags is counted (that is,numSigCoeff=numSigCoeff+1).

In addition, in a case where a coefficient level value of the codedcoefficient position (xC, yC) is equal to or higher than 2 (a value ofthe GR1 flag is 1), the variable numGreater1 is updated on the basis ofthe transform skip flag and the transform/quantization bypass flag.

In other words, if(!transform_skip_flag &&!transquant_bypass_flag){numGreater1=coeff_abs_level_greater1_flag[n]==1?numGreater1+1:numGreater1}  (eq. B-5)

Here, in Equation (eq. B-5), in a case where the transform skip or thetransform/quantization bypass is performed, the variable numGreater1 isnot updated. This is because, in a case where the transform skip or thetransform/quantization bypass is performed, the GR1 flag and the GR2flag are transform coefficients in a pixel domain, and, if variablesused to derive contexts for the GR1 flag and the GR2 flag regardingtransform coefficients in a frequency domain are updated, states of thecontexts for the GR1 flag and the GR2 flag regarding transformcoefficients in a frequency domain are not appropriately updated, andcoding efficiency may be reduced.

(Step SD207)

It is determined whether or not a coefficient position is a coefficientposition where a value of the GR1 flag initially appearing in thesub-block is 1. In a case where whether or not the coefficient positionis a coefficient position where a value of the GR1 flag initiallyappearing in the sub-block is 1 (Yes in step SD207), the flow proceedsto step SD208. In other cases, the flow proceeds to step SD209.

(Step SD208)

The coefficient position (coefficient position identification index)where a value of the GR1 flag initially appearing in the sub-block is 1is set to the variable firstGreater1CoeffIdx (that is,firstGreater1CoeffIdx=n).

(Step SD209)

The coefficient position identification index n is updated (that is,n=n−1).

(Step SD210)

The loop in the sub-block is finished.

(Coding Process of GR2 Flag)

Hereinafter, a description will be made of a coding process of the GR2flag performed by the coefficient value coding unit 225. FIG. 39 is aflowchart illustrating the coding process of the GR2 flag.

(Step SE201)

It is determined whether or not there is a coefficient in which a valueof the GR1 flag initially appearing in the sub-block, obtained in thedecoding process of the GR1 flag, is 1. In other words, it is determinedwhether or not the variable firstGreater1CoeffIdx is −1. Here, in a casewhere the variable firstGreater1CoeffIdx is not −1 (Yes in step SE201),the flow proceeds to step S202. In other cases (No in step SE101), theGR2 flag is not coded, and the coding process of the GR2 flag isfinished.

(Step SE202)

The GR2 flag (coeff_abs_level_greater2_flag[firstGreatr1CoeffIdx]) at acoefficient position indicated by the variable firstGreatr1CoeffIdx iscoded.

In addition, a derivation method of a context index which is referred tofor coding the GR2 flag is the same as the derivation method of acontext index which is referred to for decoding the GR2 flag, and thusdescription thereof will be omitted. However, in the derivation methodof a context index for decoding the GR2 flag, the term “decoding” isreplaced with the term “coding”.

(Coding Process of Remaining Coefficient Level)

Hereinafter, a description will be made of a decoding process of aremaining coefficient level performed by the coefficient value codingunit 225. FIG. 40 is a flowchart illustrating the coding process of theremaining coefficient level.

(Step SF201)

The coefficient value coding unit 225 initializes various parametersrelated to the decoding of the remaining coefficient level.

A coefficient position identification index n is set to 15 (n=15).

A coefficient number numSigCoeff is set to 0 (numSigCoeff=0).

(Step SF202)

A loop in a target sub-block is started. The loop is a loop having acoefficient position as the unit.

(Step SF203)

It is determined whether or not a coefficient position (xC, yC)specified by the coefficient position identification index n is anon-zero coefficient. In a case of the non-zero coefficient(significant_coeff_flag[xC][yC]==1) (Yes in step SF203), the flowproceeds to step SF204. In other cases(significant_coeff_flag[xC][yC]==0) (No in step SF203), the flowproceeds to step SF209.

(Step SF204)

A base level baseLevel of a transform coefficient at the coefficientposition (xC, yC) is calculated by using the following equation.

baseLevel=1+coeff_abs_level_greater1_flag[n]+coeff_abs_level_greater2_flag[n]  (eq.E-1)

(Step SF205)

It is determined whether or not the base level baseLevel of thetransform coefficient at the coefficient position (xC, yC) satisfies apredetermined value. The predetermined value is represented by thefollowing equation.

baseLevel==(numSigCoeff<TH)?((n==firstGreater1CoeffIdx)?3:2):1  (eq.E-2)

In other words, 1) in a case where the coefficient number numSigCoeff isequal to or larger than a predetermined threshold value TH(numSigCoeff>=TH), it is determined whether or not baseLevel is 1.

2) In a case where the coefficient number numSigCoeff is smaller thanthe predetermined threshold value (numSigCoeff<TH), and the coefficientposition identification index n is not firstGreater1CoeffIdx, it isdetermined whether or not baseLevel is 2.

3) In a case where the coefficient number numSigCoeff is smaller thanthe predetermined threshold value (numSigCoeff<TH), and the coefficientposition identification index n is firstGreater1CoeffIdx, it isdetermined whether or not baseLevel is 3.

As mentioned above, in a case where baseLevel is the same as the valuetaken in the above-described condition (Yes in step SF205), the flowproceeds to step SF206. In other cases (No in step SF205), the coding ofthe remaining coefficient level coeff_abs_level_remaining is skipped(treated as coeff_abs_level_remaining[n]=0), and the flow proceeds tostep SF208.

(Step SF206)

The remaining coefficient level coeff_abs_level_remaining[n] of thetransform coefficient at the coefficient position (xC, yC) is calculatedby using the following equation on the basis of the coefficient levelabsLevel and the baselevel baseLevel.

coeff_abs_level_remaining[n]=absLevel−baseLevel  (eq. E-3)

(Step SF207)

A coefficient level value absLevel of the transform coefficient at thecoefficient position (xC, yC) is calculated by using the followingequation.

absLevel=coeff_abs_level_remaining[n]+baseLevel  (eq. E-3)

(Step SF208)

The decoded coefficient number numSigCoeff is updated (that is,numSigCoeff=numSigCoeff+1).

(Step SF209)

The coefficient position identification index n is updated (that is,n=n−1).

(Step SF210)

The loop in the sub-block is finished.

APPENDIX 1

The above-described moving image coding apparatus 2 and moving imagedecoding apparatus 1 may be mounted and used in various items ofequipment which perform transmission, reception, recording, andreproducing of moving images. In addition, the moving images may benatural images which are captured by a camera or the like, and may beartificial images (including CG and GUI) generated by a computer or thelike.

First, with reference to FIG. 62, a description will be made that theabove-described moving image coding apparatus 2 and moving imagedecoding apparatus 1 can be used for transmission and reception ofmoving images.

FIG. 62( a) is a block diagram illustrating a configuration oftransmission equipment PROD_A including the moving image codingapparatus 2 mounted therein. As illustrated in FIG. 62( a), thetransmission equipment PROD_A includes a coder PROD_A1 which obtains bycoding a moving image, a modulator PROD_A2 which obtains a modulatedsignal by modulating the coded data obtained by the coder PROD_A1, and atransmitter PROD_A3 which transmits the modulated signal obtained by themodulator PROD_A2. The above-described moving image coding apparatus 2is used as the coder PROD_A1.

The transmission equipment PROD_A may further include a camera PROD_A4which captures a moving image as a supply source of a moving image whichis input to the coder PROD_A1, a recording medium PROD_A5 which recordsthe moving image thereon, an input terminal PROD_A6 for inputting amoving image from an external device, and an image processor A7 whichgenerates or processes an image. FIG. 62( a) illustrates a configurationin which the transmission equipment PROD_A includes all the constituentelements, but some of the constituent elements may be omitted.

In addition, the recording medium PROD_A5 may record a moving imagewhich is not coded, and may record a moving image which is coded in acoding method for recording different from a coding method fortransmission. In the latter case, a decoder (not illustrated) whichdecodes coded data read from the recording medium PROD_A5 according to acoding method for recording may be provided between the recording mediumPROD_A5 and the coder PROD_A1.

FIG. 62( b) is a block diagram illustrating a configuration of receptionequipment PROD_B including the moving image decoding apparatus 1 mountedtherein. As illustrated in FIG. 62( b), the reception equipment PROD_Bincludes a receiver PROD_B1 which receives a modulated signal, ademodulator PROD_B2 which obtains coded data by demodulating themodulated signal received by the receiver PROD_B1, and a decoder PROD_B3which obtains a moving image by decoding the coded data obtained by thedemodulator PROD_B2. The above-described moving image decoding apparatus1 is used as the decoder PROD_B3.

The reception equipment PROD_B may further include a display PROD_B4which displays a moving image as a supply source of the moving imagewhich is output by the decoder PROD_B3, a recording medium PROD_B5 whichrecords a moving image, and an output terminal PROD_B6 which outputs amoving image to an external device. FIG. 62( b) illustrates aconfiguration in which the reception equipment PROD_B includes all theconstituent elements, but some of the constituent elements may beomitted.

In addition, the recording medium PROD_B5 may record a moving imagewhich is not coded, and may record a moving image which is coded in acoding method for recording different from a coding method fortransmission. In the latter case, a coder (not illustrated) which codesa moving image acquired from the decoder PROD_B3 according to a codingmethod for recording may be provided between the decoder PROD_B3 and therecording medium PROD_B5.

In addition, a transmission medium for transmitting a modulated signalmay be wireless and wired. Further, a transmission aspect oftransmitting a modulated signal may be broadcast (here, indicating atransmission aspect in which a transmission destination is not specifiedin advance) and may be communication (here, indicating a transmissionaspect in which a transmission destination is specified in advance). Inother words, transmission of a modulated signal may be realized by anyone of wireless broadcast, wired broadcast, wireless communication, andwired communication.

For example, a broadcasting station (a broadcasting facility or thelike) and a reception station (a television receiver or the like) interrestrial digital broadcasting are respectively examples of thetransmission equipment PROD_A and the reception equipment PROD_B whichtransmit and receive a modulated signal in wireless broadcast. Inaddition, a broadcasting station (a broadcasting facility or the like)and a reception station (a television receiver or the like) in cabletelevision broadcasting are respectively examples of the transmissionequipment PROD_A and the reception equipment PROD_B which transmit andreceive a modulated signal in wired broadcast.

In addition, a server (a workstation or the like) and a client (atelevision receiver, a personal computer, a smart phone, or the like) ina video on demand (VOD) service or a moving image sharing service usingthe Internet or the like are respectively examples of the transmissionequipment PROD_A and the reception equipment PROD_B which transmit andreceive a modulated signal in communication (typically, either awireless or wired medium is used as a transmission medium in a LAN, anda wired medium is used as a transmission medium in a WAN). Here, thepersonal computer includes a desktop PC, a laptop PC, and a tablet PC.Further, the smart phone also includes a multifunction mobile phoneterminal.

In addition, the client in the moving image sharing service has not onlya function of decoding coded data which is downloaded from the serverand displaying the data on a display but also a function of coding amoving image captured by a camera and uploading the moving image to theserver. In other words, the client in the moving image sharing servicefunctions as both of the transmission equipment PROD_A and the receptionequipment PROD_B.

Next, with reference to FIG. 63, a description will be made that theabove-described moving image coding apparatus 2 and moving imagedecoding apparatus 1 can be used for recording and reproducing movingimages.

FIG. 63( a) is a block diagram illustrating a configuration of recordingequipment PROD_C including the moving image coding apparatus 2 mountedtherein. As illustrated in FIG. 63( a), recording equipment PROD_Cincludes a coder PROD_C1 which obtains by coding a moving image, andwriter PROD_C2 which writes the coded data obtained by the coder PROD_C1on a recording medium PROD_M. The above-described moving image codingapparatus 2 is used as the coder PROD_C1.

In addition, the recording medium PROD_M may be (1) built into therecording equipment PROD_C, such as a hard disk drive (HDD), a solidstate drive (SSD), (2) connected to the recording equipment PROD_C, suchas a SD memory card or a universal serial bus (USB) flash memory, and(3) loaded in a drive device (not illustrated) built into the recordingequipment PROD_C, such as a digital versatile disc (DVD) or a Blu-rayDisc (registered trademark, BD).

In addition, the recording equipment PROD_C may further include a cameraPROD_C3 which captures a moving image as a supply source of a movingimage which is input to the coder PROD_C1, an input terminal PROD_C4 forinputting a moving image from an external device, a receiver PROD_C5which receives a moving image, and an image processor C6 which generatesor processes an image. FIG. 63( a) illustrates a configuration in whichthe recording equipment PROD_C includes all the constituent elements,but some of the constituent elements may be omitted.

Further, the receiver PROD_C5 may receive a moving image which is notcoded, and may receive a moving image which is coded in a coding methodfor recording different from a coding method for transmission. In thelatter case, a decoder (not illustrated) for transmission which decodescoded data which is coded in a coding method for transmission may beprovided between the receiver PROD_C5 and the coder PROD_C1.

The recording equipment PROD_C may include, for example, a DVD recorder,a BD recorder, and a hard disk drive (HDD) recorder (in this case, theinput terminal PROD_C4 or the receiver PROD_C5 is a main supply sourceof a moving image). Further, examples of the recording equipment PROD_Care also a camcorder (in this case, the camera PROD_C3 is a main supplysource of a moving image), a personal computer (in this case, thereceiver PROD_C5 or the image processor C6 is a main supply source of amoving image), and a smart phone (in this case, the camera PROD_C3 orthe receiver PROD_C5 is a main supply source of a moving image).

FIG. 63( b) is a block diagram illustrating a configuration ofreproducing equipment PROD_D including the moving image decodingapparatus 1 mounted therein. As illustrated in FIG. 63( b), thereproducing equipment PROD_D includes a reader PROD_D1 which reads codeddata which is written on the recording medium PROD_M, and a coderPROD_D2 which obtains a moving image by decoding the coded data read bythe reader PROD_D1. The above-described moving image decoding apparatus1 is used as the decoder PROD_D2.

In addition, the recording medium PROD_M may be (1) built into thereproducing equipment PROD_D, such as an HDD, an SSD, (2) connected tothe reproducing equipment PROD_D, such as a SD memory card or a USBflash memory, and (3) loaded in a drive device (not illustrated) builtinto the reproducing equipment PROD_D, such as a DVD or a BD.

In addition, the reproducing equipment PROD_D may further include adisplay PROD_D3 which displays a moving image as a supply source of themoving image which is output by the decoder PROD_D2, an output terminalPROD_D4 which outputs a moving image to an external device, and atransmitter PROD_D5 which transmits a moving image. FIG. 63( b)illustrates a configuration in which the reproducing equipment PROD_Dincludes all the constituent elements, but some of the constituentelements may be omitted.

In addition, the transmitter PROD_D5 may transmit a moving image whichis not coded, and may transmit a moving image which is coded in a codingmethod for transmission different from a coding method for recording. Inthe latter case, a coder (not illustrated) which codes a moving image ina coding method for transmission may be provided between the decoderPROD_D2 and the transmitter PROD_D5.

The reproducing equipment PROD_D may include, for example, a DVD player,a BD player, and an HDD player (in this case, the output terminalPROD_D4 connected to a television receiver is a main supply source of amoving image). Further, examples of the reproducing equipment PROD_D arealso a television receiver (in this case, the display PROD_D3 is a mainsupply source of a moving image), a digital signage (also called anelectronic signboard or an electronic bulletin board; in this case, thedisplay PROD_D3 or the transmitter PROD_D5 is a main supply source of amoving image), a desktop PC (in this case, the output terminal PROD_D4or the transmitter PROD_D5 is a main supply source of a moving image), alaptop or tablet PC (in this case, the display PROD_D3 or thetransmitter PROD_D5 is a main supply source of a moving image), and asmart phone (in this case, the display PROD_D3 or the transmitterPROD_D5 is a main supply source of a moving image).

APPENDIX 2

Each block of the above-described moving image decoding apparatus 1 andmoving image coding apparatus 2 may be realized in hardware by usinglogic circuits formed on an integrated circuit (IC chip), and may berealized in software by using a central processing unit (CPU).

In the latter case, each of the moving image decoding apparatus 1 andthe moving image coding apparatus 2 includes a CPU which executescommands of a program, a read only memory (ROM) which stores theprogram, a random access memory (RAM) on which the program is developed,and a storage device (recording medium) such as a memory which storesthe program and various items of data. In addition, the object of thepresent invention can also be achieved by supplying a recording mediumwhich causes a computer to read program codes (an executable program, anintermediate code program, or a source program) of a control program ofeach of the moving image decoding apparatus 1 and the moving imagecoding apparatus 2, which is software for realizing the above-describedfunctions, to the moving image decoding apparatus 1 and the moving imagecoding apparatus 2, and by the computer (or a CPU or a micro processingunit (MPU)) reading and executing the program codes recorded on therecording medium.

As the recording medium, there may be the use of, for example, tapessuch as a magnetic tape or a cassette tape, disks or discs including amagnetic disk such as a floppy (registered trademark) disk or a harddisk and an optical disc such as a compact disc read-only memory(CD-ROM), a magneto-optical (MO), a mini disc (MD), a digital versatiledisk (DVD), or a CD-recordable (CD-R), cards such as an IC card(including a memory card) and an optical card, semiconductor memoriessuch as a mask ROM, an erasable programmable read-only memory (EPROM),an electrically erasable and programmable read-only memory (EEPROM)(registered trademark) and a flash ROM, or logic circuits such as aprogrammable logic device (PLD) and field programmable gate array(FPGA).

In addition, each of the moving image decoding apparatus 1 and themoving image coding apparatus 2 is configured to be connected to acommunication network, and the program codes may be supplied thereto viathe communication network. The communication network is not particularlylimited as long as the program codes can be transmitted. For example,the Internet, an intranet, an extranet, a local area network (LAN), anintegrated services digital network (ISDN), a value-added network (VAN),a community antenna television (CATV), a communication network, avirtual private network, a telephone line network, a mobilecommunication network, and a satellite communication network, may beused. In addition, a transmission medium forming the communicationnetwork is not particularly limited to a specific configuration or typeas long as the program codes can be transmitted. The transmission mediummay use a wired medium such as Institute Of Electrical and ElectronicEngineers (IEEE) 1394, a USB, a power line carrier, a cable TV line, atelephone line, or an asymmetric digital subscriber line (ADSL), and awireless medium such as infrared rays in Infrared Data Association(IrDA) or remote control, Bluetooth (registered trademark), IEEE802.11wireless, High Data Rate (HDR), near field communication (NFC), DigitalLiving Network Alliance (DLNA), a mobile station network, a satelliteline, or a terrestrial digital network. In addition, the presentinvention may also be realized in a form of a computer data signal whichis implemented by electronically transmitting the program codes and isembedded in a carrier.

The present invention is not limited to each of the above-describedembodiments and may have various modifications recited in the claims,and an embodiment obtained by appropriately combining the technicalmeans disclosed in the different embodiments is also included in thetechnical scope of the present invention.

INDUSTRIAL APPLICABILITY

The present invention can be suitably used for an arithmetic decodingdevice which decodes coded data which is arithmetically coded, and anarithmetic coding device which generates coded data which isarithmetically coded.

REFERENCE SIGNS LIST

-   -   1 MOVING IMAGE DECODING APPARATUS (IMAGE DECODING APPARATUS)    -   11 VARIABLE LENGTH CODE DECODING UNIT    -   111 QUANTIZED RESIDUAL INFORMATION DECODING UNIT (ARITHMETIC        CODING DEVICE)    -   120 TRANSFORM COEFFICIENT DECODING UNIT    -   123 COEFFICIENT DECODING CONTROL UNIT (SUB-BLOCK SPLITTING        MEANS, SUB-BLOCK SCAN ORDER SETTING MEANS)    -   124 COEFFICIENT PRESENCE/ABSENCE FLAG CODING UNIT (CONTEXT INDEX        DERIVING MEANS, COEFFICIENT PRESENCE/ABSENCE FLAG DECODING        MEANS)    -   124 a, 124Aa CONTEXT DERIVING MEANS SELECTING UNIT    -   124 b POSITION CONTEXT DERIVING UNIT    -   124 c ADJACENT SUB-BLOCK COEFFICIENT PRESENCE/ABSENCE CONTEXT        DERIVING UNIT    -   124 d TRANSFORM SKIP/TRANSFORM/QUANTIZATION BYPASS CONTEXT        DERIVING UNIT    -   124Ad TRANSFORM SKIP CONTEXT DERIVING UNIT    -   124 e COEFFICIENT PRESENCE/ABSENCE FLAG SETTING UNIT    -   125 COEFFICIENT VALUE DECODING UNIT (GR1 FLAG DECODING MEANS,        GR2 FLAG DECODING MEANS)    -   125 a COEFFICIENT LEVEL DECODING UNIT    -   125 b COEFFICIENT SIGN DECODING UNIT    -   125 c COEFFICIENT VALUE RECOVERING UNIT    -   125 d COEFFICIENT NUMBER DERIVING UNIT    -   125 e COEFFICIENT POSITION DERIVING UNIT    -   125 f SIGN HIDING FLAG DERIVING UNIT    -   125 g COEFFICIENT SUM CALCULATING UNIT    -   125 h SIGN CODE DERIVING UNIT    -   127 SUB-BLOCK COEFFICIENT PRESENCE/ABSENCE FLAG DECODING UNIT        (SUB-BLOCK COEFFICIENT PRESENCE/ABSENCE FLAG DECODING MEANS)    -   127 a CONTEXT DERIVING UNIT    -   127 b SUB-BLOCK COEFFICIENT PRESENCE/ABSENCE FLAG STORAGE UNIT    -   127 c SUB-BLOCK COEFFICIENT PRESENCE/ABSENCE FLAG SETTING UNIT    -   128 TRANSFORM SKIP/TRANSFORM/QUANTIZATION BYPASS FLAG DECODING        UNIT    -   130 ARITHMETIC CODE DECODING UNIT    -   131 CONTEXT RECORDING/UPDATING UNIT    -   132 BIT DECODING UNIT (SYNTAX DECODING MEANS)    -   2 MOVING IMAGE CODING APPARATUS (IMAGE CODING APPARATUS)    -   27 VARIABLE LENGTH CODE CODING UNIT    -   271 QUANTIZED RESIDUAL INFORMATION CODING UNIT (ARITHMETIC        CODING DEVICE)    -   220 TRANSFORM COEFFICIENT CODING UNIT    -   223 COEFFICIENT CODING CONTROL UNIT (SUB-BLOCK SPLITTING MEANS,        SUB-BLOCK SCAN ORDER SETTING MEANS)    -   224 COEFFICIENT PRESENCE/ABSENCE FLAG CODING UNIT (CONTEXT INDEX        DERIVING MEANS)    -   224 a, 224Aa CONTEXT DERIVING MEANS SELECTING UNIT    -   224 b POSITION CONTEXT DERIVING UNIT    -   224 c ADJACENT SUB-BLOCK COEFFICIENT PRESENCE/ABSENCE CONTEXT        DERIVING UNIT    -   224 d TRANSFORM SKIP/TRANSFORM/QUANTIZATION BYPASS CONTEXT        DERIVING UNIT    -   224Ad TRANSFORM SKIP CONTEXT DERIVING UNIT    -   224 e COEFFICIENT PRESENCE/ABSENCE FLAG SETTING UNIT    -   225 COEFFICIENT VALUE CODING UNIT (GR1 FLAG CODING MEANS, GR2        FLAG CODING MEANS)    -   2285 COEFFICIENT VALUE SYNTAX DERIVING UNIT    -   225 a COEFFICIENT LEVEL SYNTAX DERIVING UNIT    -   225 b COEFFICIENT SIGN SYNTAX DERIVING UNIT    -   225 h SIGN SYNTAX DERIVING AND A LEVEL VALUE CORRECTING UNIT    -   227 SUB-BLOCK COEFFICIENT PRESENCE/ABSENCE FLAG CODING UNIT        (SUB-BLOCK COEFFICIENT PRESENCE/ABSENCE FLAG CODING MEANS)    -   227 a CONTEXT DERIVING UNIT    -   227 b SUB-BLOCK COEFFICIENT PRESENCE/ABSENCE FLAG STORAGE UNIT    -   227 c SUB-BLOCK COEFFICIENT PRESENCE/ABSENCE FLAG SETTING UNIT    -   229 SYNTAX DERIVING UNIT    -   230 ARITHMETIC CODE CODING UNIT    -   231 CONTEXT RECORDING/UPDATING UNIT    -   232 BIT CODING UNIT (SYNTAX CODING MEANS)

1-17. (canceled)
 18. An arithmetic decoding device which decodes codeddata of each transform coefficient which is obtained for each frequencycomponent by performing frequency transform on a target image for eachunit domain and each transform coefficient in a pixel domain, obtainedthrough a transform skip or a transform/quantization bypass, the devicecomprising: context index deriving means for deriving a context index ofa non-zero transform coefficient presence/absence flag indicatingwhether or not the transform coefficient is 0, for each unit domain; andsyntax decoding means for arithmetically decoding the non-zero transformcoefficient presence/absence flag on the basis of a probability stateindicated by the derived context index, wherein the context indexderiving means derives separate context indexes for each of a non-zerocoefficient presence/absence flag corresponding to each transformcoefficient in the pixel domain, obtained through the transform skip orthe transform/quantization bypass and a non-zero coefficientpresence/absence flag corresponding to each transform coefficient whichis obtained for each frequency component through the frequencytransform.
 19. The arithmetic decoding device according to claim 18,wherein the context index deriving means derives a context index for anon-zero coefficient presence/absence flag corresponding to eachtransform coefficient in the pixel domain, obtained through thetransform skip or the transform/quantization bypass in a case where thetransform skip flag or the transform/quantization bypass flag is
 1. 20.The arithmetic decoding device according to claim 18, wherein contextindexes derived by the context index deriving means are different fromeach other depending on coefficient positions.
 21. The arithmeticdecoding device according to claim 19, wherein a common value is derivedas the context index in a case where the transform skip flag or thetransform/quantization bypass flag is
 1. 22. The arithmetic decodingdevice according to claim 19, wherein context indexes derived by thecontext index deriving means are different from each other depending oncoefficient positions.